Use raw byte string for regex
Fixes SyntaxWarning in Python 3.12 due to invalid escape sequence.
This commit is contained in:
+1
-1
@@ -302,7 +302,7 @@ def validate_signature_fields(sig, mandatory_fields=[b'v', b'a', b'b', b'bh', b'
|
|||||||
try:
|
try:
|
||||||
str(sig[b'd'], 'ascii')
|
str(sig[b'd'], 'ascii')
|
||||||
# No specials, which is close enough
|
# No specials, which is close enough
|
||||||
if re.findall(b"[\(\)<>\[\]:;@\\,]", sig[b'd']):
|
if re.findall(rb"[\(\)<>\[\]:;@\\,]", sig[b'd']):
|
||||||
raise ValidationError("d= value is not valid (%s)" % sig[b'd'])
|
raise ValidationError("d= value is not valid (%s)" % sig[b'd'])
|
||||||
except UnicodeDecodeError as e:
|
except UnicodeDecodeError as e:
|
||||||
# Not an ASCII domain
|
# Not an ASCII domain
|
||||||
|
|||||||
Reference in New Issue
Block a user