Code

Added 'Users may only edit their issues' customisation example.
[roundup.git] / roundup / rfc2822.py
index 7cee7150592c359e322623de8afd822f77653516..0faa833f2e34d047af431c34fdcb16a96acb7a29 100644 (file)
@@ -1,4 +1,5 @@
 import re
+from string import letters, digits
 from binascii import b2a_base64, a2b_base64
 
 ecre = re.compile(r'''
@@ -11,7 +12,7 @@ ecre = re.compile(r'''
   \?=                   # literal ?=
   ''', re.VERBOSE | re.IGNORECASE)
 
-hqre = re.compile(r'^[-a-zA-Z0-9!*+/\[\]., ]+$')
+hqre = re.compile(r'^[A-z0-9!"#$%%&\'()*+,-./:;<=>?@\[\]^_`{|}~ ]+$')
 
 def base64_decode(s, convert_eols=None):
     """Decode a raw base64 string.
@@ -122,7 +123,6 @@ def encode_header(header):
     if not header:
         return header
 
-    global hqre
     # return plain header if it is not contains non-ascii characters
     if hqre.match(header):
         return header