diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-09-05 14:15:32 (GMT) |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-09-05 14:15:32 (GMT) |
| commit | 6a8c8a80a1c47595652a267665bdbae2bd8489f0 (patch) | |
| tree | 7def15cc73cc0f135a337b186088dca4d7dcfd28 | |
| parent | 2c2d2aedd5c48a5fbbbb4a238b7d4e86a5f64b60 (diff) | |
| parent | d9e0b068af175a2fc1c2fe979ab97b5d4f8239b7 (diff) | |
| download | cpython-6a8c8a80a1c47595652a267665bdbae2bd8489f0.zip cpython-6a8c8a80a1c47595652a267665bdbae2bd8489f0.tar.gz cpython-6a8c8a80a1c47595652a267665bdbae2bd8489f0.tar.bz2 | |
#12888: merge with 3.2.
| -rw-r--r-- | Lib/html/parser.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_htmlparser.py | 3 | ||||
| -rw-r--r-- | Misc/ACKS | 1 | ||||
| -rw-r--r-- | Misc/NEWS | 3 |
4 files changed, 7 insertions, 2 deletions
diff --git a/Lib/html/parser.py b/Lib/html/parser.py index 9412280..a6d5be9 100644 --- a/Lib/html/parser.py +++ b/Lib/html/parser.py @@ -458,4 +458,4 @@ class HTMLParser(_markupbase.ParserBase): return '&'+s+';' return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));", - replaceEntities, s, re.ASCII) + replaceEntities, s, flags=re.ASCII) diff --git a/Lib/test/test_htmlparser.py b/Lib/test/test_htmlparser.py index 637ab01..d45e453 100644 --- a/Lib/test/test_htmlparser.py +++ b/Lib/test/test_htmlparser.py @@ -377,7 +377,8 @@ class HTMLParserTolerantTestCase(TestCaseBase): p = html.parser.HTMLParser() self.assertEqual(p.unescape('&#bad;'),'&#bad;') self.assertEqual(p.unescape('&'),'&') - + # see #12888 + self.assertEqual(p.unescape('{ ' * 1050), '{ ' * 1050) def test_main(): support.run_unittest(HTMLParserTestCase, HTMLParserTolerantTestCase) @@ -704,6 +704,7 @@ Douglas Orr Michele OrrĂ¹ Oleg Oshmyan Denis S. Otkidach +Peter Otten Michael Otteneder R. M. Oudkerk Russel Owen @@ -271,6 +271,9 @@ Core and Builtins Library ------- +- Issue #12888: Fix a bug in HTMLParser.unescape that prevented it to escape + more than 128 entities. Patch by Peter Otten. + - Issue #12878: Expose a __dict__ attribute on io.IOBase and its subclasses. - Issue #12636: IDLE reads the coding cookie when executing a Python script. |
