From: kaliko Date: Wed, 2 Jun 2021 15:31:16 +0000 (+0200) Subject: Do not limit valid UUID to version 4 X-Git-Tag: 0.18.0~52 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=7ac027b7a735bde1521f7a916a7629d3986e36c9;p=mpd-sima.git Do not limit valid UUID to version 4 --- diff --git a/sima/lib/meta.py b/sima/lib/meta.py index 26da9ca..39b3197 100644 --- a/sima/lib/meta.py +++ b/sima/lib/meta.py @@ -26,7 +26,7 @@ from collections.abc import Set import logging import re -UUID_RE = r'^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$' +UUID_RE = r'^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[89AB][a-f0-9]{3}-[a-f0-9]{12}$' # The Track Object is collapsing multiple tags into a single string using this # separator. It is used then to split back the string to tags list. SEPARATOR = chr(0x1F) # ASCII Unit Separator diff --git a/tests/test_meta.py b/tests/test_meta.py index ed241cf..783f647 100644 --- a/tests/test_meta.py +++ b/tests/test_meta.py @@ -13,7 +13,6 @@ class TestMetaObject(unittest.TestCase): wrong = VALID +'a' self.assertFalse(is_uuid4(wrong)) # test UUID4 format validation - self.assertFalse(is_uuid4(VALID.replace('4', '3'))) self.assertFalse(is_uuid4(VALID.replace('a', 'z'))) def test_init(self):