cpython: 22ddf77e0497 (original) (raw)
Mercurial > cpython
changeset 79137:22ddf77e0497 3.2
Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD() method doesn't require an argument again. [#16012]
Christian Heimes christian@cheimes.de | |
---|---|
date | Mon, 24 Sep 2012 13:17:08 +0200 |
parents | 620d23f7ad41 |
children | 0f55ad9b07c8 74b4c8c2894f |
files | Lib/test/test_pyexpat.py Misc/NEWS Modules/pyexpat.c |
diffstat | 3 files changed, 14 insertions(+), 1 deletions(-)[+] [-] Lib/test/test_pyexpat.py 10 Misc/NEWS 3 Modules/pyexpat.c 2 |
line wrap: on
line diff
--- a/Lib/test/test_pyexpat.py +++ b/Lib/test/test_pyexpat.py @@ -641,6 +641,16 @@ class ForeignDTDTests(unittest.TestCase) parser.Parse("") self.assertEqual(handler_call_args, [(None, None)])
# test UseForeignDTD() is equal to UseForeignDTD(True)[](#l1.7)
handler_call_args[:] = [][](#l1.8)
parser = expat.ParserCreate()[](#l1.10)
parser.UseForeignDTD()[](#l1.11)
parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS)[](#l1.12)
parser.ExternalEntityRefHandler = resolve_entity[](#l1.13)
parser.Parse("<?xml version='1.0'?><element/>")[](#l1.14)
self.assertEqual(handler_call_args, [(None, None)])[](#l1.15)
+ def test_ignore_use_foreign_dtd(self): """ If UseForeignDTD is passed True and a document with an external
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -482,6 +482,9 @@ Library Extension Modules ----------------- +- Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD()
- Issue #15676: Now "mmap" check for empty files before doing the offset check. Patch by Steven Willis.
--- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -1035,7 +1035,7 @@ xmlparse_UseForeignDTD(xmlparseobject *s PyObject *flagobj = NULL; int flag = 1; enum XML_Error rc;