Opened at 2011-04-01T05:50:49Z
Closed at 2011-04-01T23:46:24Z
#1388 closed defect (fixed)
nicer reporting of unparseable version numbers in deps
Reported by: | zooko | Owned by: | somebody |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.0 |
Component: | code | Version: | 1.8.2 |
Keywords: | error usability packaging setuptools foolscap verlib reviewed | Cc: | |
Launchpad Bug: |
Description
As described in #1387, if one of the dependencies has a version number that is not considered "Rational" by verlib, Tahoe-LAFS emits
File "/Users/zooko/playground/tahoe-lafs/pristine/src/allmydata/__init__.py", line 375, in <module> check_all_requirements() File "/Users/zooko/playground/tahoe-lafs/pristine/src/allmydata/__init__.py", line 373, in check_all_requirements raise PackagingError(get_error_string(errors, debug=True)) allmydata.PackagingError: TypeError: expected string or buffer
followed by a potentially large and messy-looking dump of the PYTHONPATH.
It would be better if the error message said that the problem was that a version number couldn't be parsed, as well as specifying what the version number was that couldn't be parsed and where it came from.
Attachments (1)
Change History (5)
comment:1 Changed at 2011-04-01T20:22:44Z by davidsarah
Changed at 2011-04-01T20:29:54Z by davidsarah
allmydata/init.py: Nicer reporting of unparseable version numbers in dependencies. fixes #1388
comment:2 Changed at 2011-04-01T20:31:23Z by davidsarah
- Component changed from unknown to code
- Keywords verlib review-needed added
- Milestone changed from undecided to 1.9.0
- Owner changed from nobody to somebody
comment:3 Changed at 2011-04-01T22:49:18Z by zooko
- Keywords reviewed added; review-needed removed
attachment:nicely-report-unparseable-versions.darcs.patch Looks good! Thanks! :-)
(I guess this patch doesn't need a NEWS entry.)
comment:4 Changed at 2011-04-01T23:46:24Z by david-sarah@…
- Resolution set to fixed
- Status changed from new to closed
In f3246a9ca013807a:
It's a bug in verlib that it raises TypeError rather than IrrationalVersionError.
I also agree that it is a bug in check_all_requirements (or check_requirement) that the error doesn't say that a version number couldn't be parsed, what the number was, or where it came from.
However, it's not clear to me that it's wrong to print the large and messy-looking PYTHONPATH dump. The purpose of that dump is to be able to debug path problems on users' machines that might otherwise be difficult to reproduce.