[issue14894] distutils.LooseVersion fails to compare number and a word

Barry A. Warsaw report at bugs.python.org
Thu May 24 17:12:59 CEST 2012


Barry A. Warsaw <barry at python.org> added the comment:

On May 24, 2012, at 03:03 PM, Éric Araujo wrote:

>> But if 'a' is invalid, then LooseVersion should refuse to accept it in its
>> constructor, right?

>It’s complicated.  The doc does not say much, the docstring however clearly
>states that versions should start with a digit, but a ton of projects use
>invalid-but-not-rejected formats.  distutils2 makes a clean break with clear
>rules (PEP 386); I’m not sure it would be acceptable for distutils to
>suddenly reject these versions.  It sounds useful but even with that change
>people would not always comply with PEP 386, so better let them use broken
>versions with distutils and force a switch to a fully compliant format with
>d2.  Does that make sense?

It does, but in that case, I think the comparison should continue to succeed,
with whatever results it produces in Python 2.7.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14894>
_______________________________________


More information about the Python-bugs-list mailing list