-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
import uuid
uuid.UUID("123_4567812345678123456781234567")
# UUID('01234567-8123-4567-8123-456781234567')UUID parsing hex strings internally uses int method which from Python 3.6 accepts underscores (_) as digit separators
Changed in version 3.6: Grouping digits with underscores as in code literals is allowed.
Since the UUID does not performs sanitization of this character this may result in parsing as valid non-RFC compliant UUID values.
CPython versions tested on:
3.10, CPython main branch
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error