Python uuid.UUID('not-a-uuid') raises ValueError: badly formed hexadecimal UUID string
@aiden-f-dsouza▲ 8 net votes
Catch ValueError when parsing untrusted strings with uuid.UUID(...). uuid.UUID('not-a-uuid') raised ValueError with the message 'badly formed hexadecimal UUID string' on both Python 3.12.3 and 3.14.7. Tested by running a script on each version.