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
ca4daa2b
Commit
ca4daa2b
authored
Aug 13, 2009
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport of r74435. Not merged/blocked w/ svnmerge.py as the tool is erroring out on me.
parent
0884ec1a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
Lib/test/test_pyexpat.py
Lib/test/test_pyexpat.py
+20
-1
Misc/NEWS
Misc/NEWS
+2
-0
Modules/expat/xmltok_impl.c
Modules/expat/xmltok_impl.c
+1
-1
No files found.
Lib/test/test_pyexpat.py
View file @
ca4daa2b
...
...
@@ -510,6 +510,24 @@ class ChardataBufferTest(unittest.TestCase):
parser
.
Parse
(
xml2
,
1
)
self
.
assertEquals
(
self
.
n
,
4
)
class
MalformedInputText
(
unittest
.
TestCase
):
def
test1
(
self
):
xml
=
"
\
0
\
r
\
n
"
parser
=
expat
.
ParserCreate
()
try
:
parser
.
Parse
(
xml
,
True
)
self
.
fail
()
except
expat
.
ExpatError
as
e
:
self
.
assertEquals
(
str
(
e
),
'no element found: line 2, column 1'
)
def
test2
(
self
):
xml
=
"<?xml version
\
xc2
\
x85
='1.0'?>
\
r
\
n
"
parser
=
expat
.
ParserCreate
()
try
:
parser
.
Parse
(
xml
,
True
)
self
.
fail
()
except
expat
.
ExpatError
as
e
:
self
.
assertEquals
(
str
(
e
),
'XML declaration not well-formed: line 1, column 14'
)
def
test_main
():
run_unittest
(
SetAttributeTest
,
...
...
@@ -520,7 +538,8 @@ def test_main():
HandlerExceptionTest
,
PositionTest
,
sf1296433Test
,
ChardataBufferTest
)
ChardataBufferTest
,
MalformedInputText
)
if
__name__
==
"__main__"
:
test_main
()
Misc/NEWS
View file @
ca4daa2b
...
...
@@ -105,6 +105,8 @@ syntax error.
Extension Modules
-----------------
- Fix a segfault in expat.
- Issue #4509: array.array objects are no longer modified after an operation
failing due to the resize restriction in-place when the object has exported
buffers.
...
...
Modules/expat/xmltok_impl.c
View file @
ca4daa2b
...
...
@@ -1741,7 +1741,7 @@ PREFIX(updatePosition)(const ENCODING *enc,
const
char
*
end
,
POSITION
*
pos
)
{
while
(
ptr
!=
end
)
{
while
(
ptr
<
end
)
{
switch
(
BYTE_TYPE
(
enc
,
ptr
))
{
#define LEAD_CASE(n) \
case BT_LEAD ## n: \
...
...
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