This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author larry
Recipients larry
Date 2009-03-25.16:26:13
SpamBayes Score 5.526418e-07
Marked as misclassified No
Message-id <1237998375.74.0.567262091679.issue5561@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation for platform.python_version_tuple() says:
"Returns the Python version as tuple (major, minor, patchlevel) of strings."

In 2.4 and 2.5 it correctly returned a tuple of strings.  In 2.6 it
returns a tuple of ints.

In 2.4 and 2.5 the implementation was this:
  return string.split(_sys_version()[0], '.')
In 2.6 it changed to this:
    if hasattr(sys, 'version_info'):
        return sys.version_info[:3]
    return tuple(string.split(_sys_version()[1], '.'))
The fields used from sys.version_info are ints, and always have been.  I
am mystified as to why the "if hasattr" lines were added; they broke it,
and it's not like that's superior information somehow.

I suggest modernizing it slightly when you fix the bug; use the .split()
method on strings.  Like so:
    return tuple(_sys_version()[1].split('.'))
History
Date User Action Args
2009-03-25 16:26:16Larry Hastingssetrecipients: + Larry Hastings
2009-03-25 16:26:15Larry Hastingssetmessageid: <1237998375.74.0.567262091679.issue5561@psf.upfronthosting.co.za>
2009-03-25 16:26:14Larry Hastingslinkissue5561 messages
2009-03-25 16:26:13Larry Hastingscreate