(original) (raw)

changeset: 79137:22ddf77e0497 branch: 3.2 parent: 79107:620d23f7ad41 user: Christian Heimes christian@cheimes.de date: Mon Sep 24 13:17:08 2012 +0200 files: Lib/test/test_pyexpat.py Misc/NEWS Modules/pyexpat.c description: Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD() method doesn't require an argument again. diff -r 620d23f7ad41 -r 22ddf77e0497 Lib/test/test_pyexpat.py --- a/Lib/test/test_pyexpat.py Sun Sep 23 19:55:21 2012 +0200 +++ b/Lib/test/test_pyexpat.py Mon Sep 24 13:17:08 2012 +0200 @@ -641,6 +641,16 @@ parser.Parse("") self.assertEqual(handler_call_args, [(None, None)]) + # test UseForeignDTD() is equal to UseForeignDTD(True) + handler_call_args[:] = [] + + parser = expat.ParserCreate() + parser.UseForeignDTD() + parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS) + parser.ExternalEntityRefHandler = resolve_entity + parser.Parse("") + self.assertEqual(handler_call_args, [(None, None)]) + def test_ignore_use_foreign_dtd(self): """ If UseForeignDTD is passed True and a document with an external diff -r 620d23f7ad41 -r 22ddf77e0497 Misc/NEWS --- a/Misc/NEWS Sun Sep 23 19:55:21 2012 +0200 +++ b/Misc/NEWS Mon Sep 24 13:17:08 2012 +0200 @@ -482,6 +482,9 @@ Extension Modules ----------------- +- Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD() + method doesn't require an argument again. + - Issue #15676: Now "mmap" check for empty files before doing the offset check. Patch by Steven Willis. diff -r 620d23f7ad41 -r 22ddf77e0497 Modules/pyexpat.c --- a/Modules/pyexpat.c Sun Sep 23 19:55:21 2012 +0200 +++ b/Modules/pyexpat.c Mon Sep 24 13:17:08 2012 +0200 @@ -1035,7 +1035,7 @@ PyObject *flagobj = NULL; int flag = 1; enum XML_Error rc; - if (!PyArg_ParseTuple(args, "O:UseForeignDTD", &flagobj)) + if (!PyArg_ParseTuple(args, "|O:UseForeignDTD", &flagobj)) return NULL; if (flagobj != NULL) { flag = PyObject_IsTrue(flagobj);/christian@cheimes.de