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
290fed43
Commit
290fed43
authored
May 04, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #26873: xmlrpc now raises ResponseError on unsupported type tags
instead of silently return incorrect result.
parent
a3fd0b26
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
Lib/test/test_xmlrpc.py
Lib/test/test_xmlrpc.py
+14
-0
Lib/xmlrpc/client.py
Lib/xmlrpc/client.py
+3
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_xmlrpc.py
View file @
290fed43
...
...
@@ -224,6 +224,20 @@ class XMLRPCTestCase(unittest.TestCase):
self
.
assertIs
(
type
(
newvalue
),
xmlrpclib
.
Binary
)
self
.
assertIsNone
(
m
)
def
test_loads_unsupported
(
self
):
ResponseError
=
xmlrpclib
.
ResponseError
data
=
'<params><param><value><spam/></value></param></params>'
self
.
assertRaises
(
ResponseError
,
xmlrpclib
.
loads
,
data
)
data
=
(
'<params><param><value><array>'
'<value><spam/></value>'
'</array></value></param></params>'
)
self
.
assertRaises
(
ResponseError
,
xmlrpclib
.
loads
,
data
)
data
=
(
'<params><param><value><struct>'
'<member><name>a</name><value><spam/></value></member>'
'<member><name>b</name><value><spam/></value></member>'
'</struct></value></param></params>'
)
self
.
assertRaises
(
ResponseError
,
xmlrpclib
.
loads
,
data
)
def
test_get_host_info
(
self
):
# see bug #3613, this raised a TypeError
transp
=
xmlrpc
.
client
.
Transport
()
...
...
Lib/xmlrpc/client.py
View file @
290fed43
...
...
@@ -640,6 +640,7 @@ class Unmarshaller:
self
.
_stack
=
[]
self
.
_marks
=
[]
self
.
_data
=
[]
self
.
_value
=
False
self
.
_methodname
=
None
self
.
_encoding
=
"utf-8"
self
.
append
=
self
.
_stack
.
append
...
...
@@ -669,6 +670,8 @@ class Unmarshaller:
if
tag
==
"array"
or
tag
==
"struct"
:
self
.
_marks
.
append
(
len
(
self
.
_stack
))
self
.
_data
=
[]
if
self
.
_value
and
tag
not
in
self
.
dispatch
:
raise
ResponseError
(
"unknown tag %r"
%
tag
)
self
.
_value
=
(
tag
==
"value"
)
def
data
(
self
,
text
):
...
...
Misc/NEWS
View file @
290fed43
...
...
@@ -107,6 +107,9 @@ Core and Builtins
Library
-------
- Issue #26873: xmlrpc now raises ResponseError on unsupported type tags
instead of silently return incorrect result.
- Issue #26711: Fixed the comparison of plistlib.Data with other types.
- Issue #24114: Fix an uninitialized variable in `ctypes.util`.
...
...
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