Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6b590c7b
Commit
6b590c7b
authored
Sep 24, 2012
by
Christian Heimes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD()
method doesn't require an argument again.
parent
90fb338a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
Lib/test/test_pyexpat.py
Lib/test/test_pyexpat.py
+10
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/pyexpat.c
Modules/pyexpat.c
+1
-1
No files found.
Lib/test/test_pyexpat.py
View file @
6b590c7b
...
...
@@ -641,6 +641,16 @@ class ForeignDTDTests(unittest.TestCase):
parser
.
Parse
(
"<?xml version='1.0'?><element/>"
)
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
(
"<?xml version='1.0'?><element/>"
)
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
...
...
Misc/NEWS
View file @
6b590c7b
...
...
@@ -482,6 +482,9 @@ Library
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.
...
...
Modules/pyexpat.c
View file @
6b590c7b
...
...
@@ -1035,7 +1035,7 @@ xmlparse_UseForeignDTD(xmlparseobject *self, PyObject *args)
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment