From 7ac027b7a735bde1521f7a916a7629d3986e36c9 Mon Sep 17 00:00:00 2001 From: kaliko Date: Wed, 2 Jun 2021 17:31:16 +0200 Subject: [PATCH] Do not limit valid UUID to version 4 --- sima/lib/meta.py | 2 +- tests/test_meta.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) 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): -- 2.39.5