[issue36757] uuid constructor accept invalid strings (extra dash)

Tal Einat report at bugs.python.org
Mon Aug 5 06:21:04 EDT 2019


Tal Einat <taleinat at gmail.com> added the comment:

I too find this surprising, especially given how thoroughly UUID validates inputs of types other than "hex".

The documentation simply states that for hex input, hypens, curly braces and a URN prefix are optional.  In practice, though, it is much more lenient than that, as described here.

Since the UUID has no expert listed, we'll have to decide whether to make the input validation stricter and break backwards-compatibility, or simply make the docs clearer.  Clarifying the docs certainly seems simpler, safer and more user-friendly.  It also seems reasonable, given that this issue apparently hasn't affected many users.

----------
nosy: +taleinat
type:  -> behavior
versions:  -Python 3.5, Python 3.6

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


More information about the Python-bugs-list mailing list