Modify ↓
#11997 closed defect (fixed)
Wrong usage of `pkg_resources.parse_version` in ticketlog/web_ui.py
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Component: | TracTicketChangelogPlugin |
Severity: | minor | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
I found wrong usage of pkg_resources.parse_version
in tracticketchangelogplugin/0.12/ticketlog/web_ui.py@14178:60#L57.
I consider that self.supports_multirepos
is always True
with any versions of Trac.
>>> from pkg_resources import parse_version >>> parse_version('0.11.7') ('00000000', '00000011', '00000007', '*final') >>> parse_version('0.12.5') ('00000000', '00000012', '00000005', '*final') >>> parse_version('0.11.7') >= (0, 12) True >>> parse_version('0.12.5') >= (0, 12) True >>> parse_version('1.0.1') >= (0, 12) True >>> parse_version('1.1.1') >= (0, 12) True
I think that we should use parse_version('0.12')
rather than (0, 12)
.
-
ticketlog/web_ui.py
57 57 def __init__(self): 58 58 locale_dir = resource_filename(__name__, 'locale') 59 59 add_domain(self.env.path, locale_dir) 60 self.supports_multirepos = parse_version(trac.__version__) >= (0, 12) 60 self.supports_multirepos = parse_version(trac.__version__) >= \ 61 parse_version('0.12') 61 62 62 63 # IPermissionRequestor methods 63 64
>>> parse_version('0.11.7') >= parse_version('0.12') False >>> parse_version('0.12') >= parse_version('0.12') True >>> parse_version('0.12.1') >= parse_version('0.12') True
Attachments (0)
Change History (4)
comment:1 Changed 10 years ago by
Severity: | normal → minor |
---|---|
Trac Release: | → 0.11 |
comment:2 Changed 10 years ago by
comment:4 Changed 10 years ago by
Owner: | changed from Richard Liao to Jun Omae |
---|
Note: See
TracTickets for help on using
tickets.
That was my error in [13954]. Please feel free to fix the issue.