Incorrect max version computation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pkginfo |
Fix Released
|
Undecided
|
Tres Seaver |
Bug Description
The `MAX_METADATA_
version sort is the same as tuple version sort, which is not the case. (Ok,
actually, they are the same for the current set of metadata versions that
pkginfo supports, but this is not true for all possible versions.)
For example, consider a hypthetical future version 2.11:
$ bzr diff
=== modified file 'pkginfo/
--- old/pkginfo/
+++ new/pkginfo/
@@ -86,6 +86,7 @@
'2.1': HEADER_ATTRS_2_1,
'2.2': HEADER_ATTRS_2_2,
'2.3': HEADER_ATTRS_2_3,
+ '2.11': HEADER_ATTRS_2_3,
}
Note how `MAX_METADATA_
inconsistent:
$ python
>>> from pkginfo import distribution
>>> distribution.
(2, 11)
>>> distribution.
'2.3'
Here's a diff to fix the issue:
=== modified file 'pkginfo/
--- old/pkginfo/
+++ new/pkginfo/
@@ -95,12 +95,8 @@
)
-METADATA_
- _version_tuple(key) for key in HEADER_ATTRS
-]
-
-MAX_
-MAX_
+MAX_
+MAX_
class UnknownMetadata
(I tried really hard to submit this as a merge proposal, but I could not for the life of me figure out how to create a branch on launchpad).
Changed in pkginfo: | |
status: | Fix Committed → Fix Released |
Thanks very much for the report! Fixed in https:/ /bazaar. launchpad. net/~tseaver/ pkginfo/ trunk/revision/ 237