diff options
| author | Georg Brandl <georg@python.org> | 2006-11-16 17:08:48 (GMT) |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2006-11-16 17:08:48 (GMT) |
| commit | dd3bffb679f8c76ffb1ac9a9a4a7fb515e0f4447 (patch) | |
| tree | 3d875537eb95d43fb5f72a032f3eb1b475ccdf90 | |
| parent | 7563191cf6d6794c58c2ae3a4d0aa8e59f91f5db (diff) | |
| download | cpython-dd3bffb679f8c76ffb1ac9a9a4a7fb515e0f4447.zip cpython-dd3bffb679f8c76ffb1ac9a9a4a7fb515e0f4447.tar.gz cpython-dd3bffb679f8c76ffb1ac9a9a4a7fb515e0f4447.tar.bz2 | |
Bug #1588217: don't parse "= " as a soft line break in binascii's
a2b_qp() function, instead leave it in the string as quopri.decode()
does.
(backport from rev. 52765)
| -rwxr-xr-x | Lib/test/test_binascii.py | 2 | ||||
| -rw-r--r-- | Misc/NEWS | 4 | ||||
| -rw-r--r-- | Modules/binascii.c | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_binascii.py b/Lib/test/test_binascii.py index 8df4504..8272ad9 100755 --- a/Lib/test/test_binascii.py +++ b/Lib/test/test_binascii.py @@ -134,7 +134,7 @@ class BinASCIITest(unittest.TestCase): pass else: self.fail("binascii.a2b_qp(**{1:1}) didn't raise TypeError") - self.assertEqual(binascii.a2b_qp("= "), "") + self.assertEqual(binascii.a2b_qp("= "), "= ") self.assertEqual(binascii.a2b_qp("=="), "=") self.assertEqual(binascii.a2b_qp("=AX"), "=AX") self.assertRaises(TypeError, binascii.b2a_qp, foo="bar") @@ -70,6 +70,10 @@ Core and builtins Extension Modules ----------------- +- Bug #1588217: don't parse "= " as a soft line break in binascii's + a2b_qp() function, instead leave it in the string as quopri.decode() + does. + - Patch #838546: Make terminal become controlling in pty.fork() - Patch #1560695: Add .note.GNU-stack to ctypes' sysv.S so that diff --git a/Modules/binascii.c b/Modules/binascii.c index 3b2c8b2..4dee451 100644 --- a/Modules/binascii.c +++ b/Modules/binascii.c @@ -1057,8 +1057,7 @@ binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs) in++; if (in >= datalen) break; /* Soft line breaks */ - if ((data[in] == '\n') || (data[in] == '\r') || - (data[in] == ' ') || (data[in] == '\t')) { + if ((data[in] == '\n') || (data[in] == '\r')) { if (data[in] != '\n') { while (in < datalen && data[in] != '\n') in++; } |
