Repository navigation
Fix clang-cl version in sys.version on Windows #157368
Copy link
Copy link
Closed
Labels
OS-unsupportedOS-windowsinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errorinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
on Sep 12, 2026 JYFI, if you're planning to fix this yourself I suggest you assign yourself, otherwise agents have a habit of sending PRs for such things...
Reacted by Chris EiblHope I was faster :)
Reacted by Stan Ulbrych and An LongAdding
OS-unsupportedagain since @encukou ask me to do so for clang-cl issues in #154210 (comment).Aargh, sorry, that makes sense!
- added a commit that references this issue
on Sep 15, 2026 Done other than 3.15, which I think will probably wait for 3.15.0 final.
Reacted by Chris EiblReacted by Chris Eibl- moved this from In Progress to Done in Unsupported platforms
on Sep 15, 2026 - added a commit that references this issue
on Sep 17, 2026 I wrote PR gh-158608 to allocate Py_GetVersion() on the heap memory, to no longer have fixed limits.
Metadata
Metadata
Assignees
Labels
OS-unsupportedOS-windowsinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsDone
Bug report
Bug description:
Since version 22, clang-cl on Windows includes the repo url and commit hash in
__clang_version__likeversus just
21.1.4. before.This results in sys.version being truncated
__clang_version__is used incpython/PC/pyconfig.h
Line 161 in 7bfa97f
exposed via getcompiler.c and then truncated in
cpython/Python/getversion.c
Lines 17 to 23 in 7bfa97f
versus
A lot of code depends on being able to parse the now missing
64 bit (AMD64)part (#145410, #154200, #154199, ...). Let's restore the old behaviour and fix the stray]as well:This also fixes the failing
test_single_line_statementof @zware's AMD64 Windows Server 2025 Clang 3.x buildbot (and would also fix all the failing tests of the 3.14 and 3.15 Windows clang buildbots).CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows
Linked PRs