We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
3.10, CPython main branch
Linux
The text was updated successfully, but these errors were encountered:
pythongh-125651: Fix UUID hex parsing with underscores
6c7a1c5
pythongh-125651: Use regex to avoid any unallowed character to passed…
cde9e36
… to int
pythongh-125651: Remove duplicated check in test
6719b85
pythongh-125651: Add test for unicode sequence and adjust news message
5961212
No branches or pull requests
Bug report
Bug description:
UUID parsing hex strings internally uses int method which from Python 3.6 accepts underscores (
_
) as digit separatorsSince 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
The text was updated successfully, but these errors were encountered: