Ned Deily added the comment:
My understanding is that the "+" is added to the PY_VERSION in
Include/patchlevel.h by the release management process after any tagged
release, whether pre-release or final. So '+" is supposed to be set whenever
CPython is built from anything other than an official tagged revision. AFAICT,
"py_version" and friends were added to sysconfig when sysconfig was initially
moved out of distutils (in fa69e891edf4) to become its own standalone module as
part of the last big set of distutils enhancements which were later largely
reverted, ending up with two versions of sysconfig: the newer standalone
sysconfig.py and with the older distutils/sysconfig.py. It appears
"py_version" and friends have never been implemented in the
distutils/sysconfig.py so it's likely that they aren't used much in the wild
but it would be nice to not break the current compatibility. Perhaps expanding
sys.version_info to contain the "modified" (?) ("+") field would be a good idea
or possibly adding a new value to
"releaselevel". As it currently stands:
$ /usr/local/bin/python3.5
Python 3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version
'3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44) \n[GCC 4.2.1 (Apple Inc.
build 5666) (dot 3)]'
>>> sys.version_info
sys.version_info(major=3, minor=5, micro=1, releaselevel='final', serial=0)
$ ./python
Python 3.5.1+ (default, Feb 11 2016, 14:00:02)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version_info
sys.version_info(major=3, minor=5, micro=1, releaselevel='final', serial=0)
>>> sys.version
'3.5.1+ (default, Feb 11 2016, 14:00:02) \n[GCC 4.2.1 Compatible Apple LLVM
7.0.2 (clang-700.1.81)]'
It seems wrong that one cannot use sys.version_info to distinguish between a
release build and a post-release development build.
I'm nosying Georg and Benjamin for institutional memory picking.
----------
nosy: +benjamin.peterson, georg.brandl, ned.deily
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue24916>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com