You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2019-07-14.14:18:09.238>labels= ['type-feature', 'library', '3.9']
title='sysconfig should not rely on sys.version'updated_at=<Date2019-07-14.14:20:50.854>user='https://github.com/carlbordum'
No, it is still used to calculate _PY_VERSION, and is also used in get_platform, which the original PR did not touch. I don't think it's a huge issue, but as the documentation advises us to not extract information from it, we should replace such usages.
No, it is still used to calculate _PY_VERSION, and is also used in get_platform, which the original PR did not touch. I don't think it's a huge issue, but as the documentation advises us to not extract information from it, we should replace such usages.
I wrote #146149 but I'm not sure that this change is worth it. _PY_VERSION = sys.version.split()[0] just works. I prefer to just close this issue.
Reopen it if you consider that sysconfig should really not parse sys.version string (to set _PY_VERSION).
Activity
carlbordum commentedon Jul 14, 2019
I found this FIXME and replaced it with code that follows the git tags naming scheme.
mattip commentedon Nov 16, 2022
PR #14776 was closed, deferring to PR #24644 so I think this issue should be closed.
FFY00 commentedon Nov 21, 2022
No, it is still used to calculate
_PY_VERSION, and is also used inget_platform, which the original PR did not touch. I don't think it's a huge issue, but as the documentation advises us to not extract information from it, we should replace such usages.FFY00 commentedon Nov 21, 2022
cpython/Lib/sysconfig.py
Line 169 in 6d8da23
cpython/Lib/sysconfig.py
Lines 765 to 770 in 6d8da23
vstinner commentedon Mar 19, 2026
I removed this code in PR gh-146145 which adds
_sysconfig.get_platform()on Windows.The last line using
sys.versioninsysconfigis:_PY_VERSION = sys.version.split()[0].pythongh-81773: Avoid parsing sys.version string in sysconfig
vstinner commentedon Mar 19, 2026
I created #146149 to add
_sysconfig._PY_VERSION.vstinner commentedon Mar 26, 2026
@FFY00:
I wrote #146149 but I'm not sure that this change is worth it.
_PY_VERSION = sys.version.split()[0]just works. I prefer to just close this issue.Reopen it if you consider that
sysconfigshould really not parsesys.versionstring (to set_PY_VERSION).