From a0a3805e2d6961c9e794e1cf0517727902186fb2 Mon Sep 17 00:00:00 2001 From: Stefan Wojcik Date: Sat, 15 Apr 2017 23:14:19 -0400 Subject: [PATCH] Revert "switch from octal to hex for consistency" (because of pypy3) This reverts commit 7d5caf836855cc9b843d50df8b17aa4ff897bd6d. --- mongoengine/fields.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mongoengine/fields.py b/mongoengine/fields.py index 7a8b359d..b631fc48 100644 --- a/mongoengine/fields.py +++ b/mongoengine/fields.py @@ -159,7 +159,7 @@ class EmailField(StringField): # `dot-atom` defined in RFC 5322 Section 3.2.3. r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*\Z" # `quoted-string` defined in RFC 5322 Section 3.2.4. - r'|^"([\x01-\x08\x0b\x0c\x0e-\x1f!#-\[\]-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*"\Z)', + r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"\Z)', re.IGNORECASE ) @@ -167,9 +167,9 @@ class EmailField(StringField): six.u( # RFC 6531 Section 3.3 extends `atext` (used by dot-atom) to # include `UTF8-non-ascii`. - r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z\x80-\U0010FFFF]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z\x80-\U0010FFFF]+)*\Z" + r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z\u0080-\U0010FFFF]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z\u0080-\U0010FFFF]+)*\Z" # `quoted-string` - r'|^"([\x01-\x08\x0b\x0c\x0e-\x1f!#-\[\]-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*"\Z)', + r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"\Z)' ), re.IGNORECASE | re.UNICODE )