[Python-checkins] cpython (merge 3.3 -> default): #18380: merge with 3.3.
ezio.melotti
python-checkins at python.org
Sat Jul 6 17:17:59 CEST 2013
http://hg.python.org/cpython/rev/6e23ce14c3c6
changeset: 84463:6e23ce14c3c6
parent: 84461:dbd301063e59
parent: 84462:c8fd1351c840
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Sat Jul 06 17:17:45 2013 +0200
summary:
#18380: merge with 3.3.
files:
Lib/email/quoprimime.py | 2 +-
Lib/test/test_email/test_email.py | 4 ++++
Misc/ACKS | 1 +
3 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/Lib/email/quoprimime.py b/Lib/email/quoprimime.py
--- a/Lib/email/quoprimime.py
+++ b/Lib/email/quoprimime.py
@@ -319,4 +319,4 @@
the high level email.header class for that functionality.
"""
s = s.replace('_', ' ')
- return re.sub(r'=[a-fA-F0-9]{2}', _unquote_match, s, re.ASCII)
+ return re.sub(r'=[a-fA-F0-9]{2}', _unquote_match, s, flags=re.ASCII)
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py
--- a/Lib/test/test_email/test_email.py
+++ b/Lib/test/test_email/test_email.py
@@ -4048,6 +4048,10 @@
def test_header_decode_non_ascii(self):
self._test_header_decode('hello=C7there', 'hello\xc7there')
+ def test_header_decode_re_bug_18380(self):
+ # Issue 18380: Call re.sub with a positional argument for flags in the wrong position
+ self.assertEqual(quoprimime.header_decode('=30' * 257), '0' * 257)
+
def _test_decode(self, encoded, expected_decoded, eol=None):
if eol is None:
decoded = quoprimime.decode(encoded)
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -871,6 +871,7 @@
Pablo Mouzo
Mher Movsisyan
Ruslan Mstoi
+Valentina Mukhamedzhanova
Michael Mulich
Sape Mullender
Sjoerd Mullender
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list