VMM: Post-2to3 fix. Use the re.ASCII flag for ASCII-only patterns. v0.7.x
authorPascal Volk <user@localhost.localdomain.org>
Sat, 05 Jan 2013 18:33:52 +0000
branchv0.7.x
changeset 673 de046a3b29a5
parent 672 d3fd9bb0a5ea
child 674 995203a101e1
VMM: Post-2to3 fix. Use the re.ASCII flag for ASCII-only patterns. The local-part of an email address and Postfix configuration parameters may contain only ASCII characters.
VirtualMailManager/emailaddress.py
VirtualMailManager/ext/postconf.py
--- a/VirtualMailManager/emailaddress.py	Sat Jan 05 18:23:05 2013 +0000
+++ b/VirtualMailManager/emailaddress.py	Sat Jan 05 18:33:52 2013 +0000
@@ -16,7 +16,7 @@
 from VirtualMailManager.errors import DomainError, EmailAddressError as EAErr
 
 
-RE_LOCALPART = re.compile(r"[^\w!#$%&'\*\+-\.\/=?^_`{\|}~]")
+RE_LOCALPART = re.compile(r"[^\w!#$%&'\*\+-\.\/=?^_`{\|}~]", re.ASCII)
 _ = lambda msg: msg
 
 
--- a/VirtualMailManager/ext/postconf.py	Sat Jan 05 18:23:05 2013 +0000
+++ b/VirtualMailManager/ext/postconf.py	Sat Jan 05 18:33:52 2013 +0000
@@ -25,8 +25,8 @@
 class Postconf(object):
     """Wrapper class for Postfix's postconf."""
     __slots__ = ('_bin', '_val')
-    _parameter_re = re.compile(r'^\w+$')
-    _variables_re = re.compile(r'\$\b\w+\b')
+    _parameter_re = re.compile(r'^\w+$', re.ASCII)
+    _variables_re = re.compile(r'\$\b\w+\b', re.ASCII)
 
     def __init__(self, postconf_bin):
         """Creates a new Postconf instance.