Closed
Labels
3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Description
| BPO | 37592 |
|---|---|
| Nosy | @tarekziade, @carlbordum |
| PRs |
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 = None
closed_at = None
created_at = <Date 2019-07-14.14:18:09.238>
labels = ['type-feature', 'library', '3.9']
title = 'sysconfig should not rely on sys.version'
updated_at = <Date 2019-07-14.14:20:50.854>
user = 'https://github.com/carlbordum'bugs.python.org fields:
activity = <Date 2019-07-14.14:20:50.854>
actor = 'carlbordum'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2019-07-14.14:18:09.238>
creator = 'carlbordum'
dependencies = []
files = []
hgrepos = []
issue_num = 37592
keywords = ['patch']
message_count = 1.0
messages = ['347916']
nosy_count = 2.0
nosy_names = ['tarek', 'carlbordum']
pr_nums = ['14776']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue37592'
versions = ['Python 3.9']Linked PRs
Metadata
Metadata
Assignees
Labels
3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
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).