[issue42539] Missing parenthesis in `platform._sys_version_parser`

Mingchii Suen report at bugs.python.org
Wed Dec 2 09:05:34 EST 2020


New submission from Mingchii Suen <crazy95sun at gmail.com>:

in `platform.py`, `_sys_version_parser`
the last part of regex is `r'\[([^\]]+)\]?'`
which should be `r'(?:\[([^\]]+)\])?'

without this change, the question mark only make the last `\]` optional, not the whole part optional

this will cause unable to detect python implementation issue in some custom build python if the `[compiler]` part in `sys.version` is missing

will make a pull request soon
I have o

----------
components: Library (Lib)
messages: 382313
nosy: crazy95sun
priority: normal
severity: normal
status: open
title: Missing parenthesis in `platform._sys_version_parser`
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42539>
_______________________________________


More information about the Python-bugs-list mailing list