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
c4fec937
Commit
c4fec937
authored
Oct 30, 2011
by
Florent Xicluna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup xmlrpc: remove obsolete comments, unused imports. Add test for bytes marshalling.
parent
3fa29f7c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
21 deletions
+11
-21
Lib/test/test_xmlrpc.py
Lib/test/test_xmlrpc.py
+4
-1
Lib/xmlrpc/client.py
Lib/xmlrpc/client.py
+6
-18
Lib/xmlrpc/server.py
Lib/xmlrpc/server.py
+1
-2
No files found.
Lib/test/test_xmlrpc.py
View file @
c4fec937
...
...
@@ -140,6 +140,9 @@ class XMLRPCTestCase(unittest.TestCase):
(
'host.tld'
,
[(
'Authorization'
,
'Basic dXNlcg=='
)],
{}))
def
test_dump_bytes
(
self
):
self
.
assertRaises
(
TypeError
,
xmlrpclib
.
dumps
,
(
b"my dog has fleas"
,))
def
test_ssl_presence
(
self
):
try
:
import
ssl
...
...
@@ -177,7 +180,7 @@ class FaultTestCase(unittest.TestCase):
self
.
assertRaises
(
xmlrpclib
.
Fault
,
xmlrpclib
.
loads
,
s
)
def
test_dotted_attribute
(
self
):
# this will raise Att
ire
buteError because code don't want us to use
# this will raise Att
ri
buteError because code don't want us to use
# private methods
self
.
assertRaises
(
AttributeError
,
xmlrpc
.
server
.
resolve_dotted_attribute
,
str
,
'__add'
)
...
...
Lib/xmlrpc/client.py
View file @
c4fec937
...
...
@@ -85,11 +85,6 @@
# OF THIS SOFTWARE.
# --------------------------------------------------------------------
#
# things to look into some day:
# TODO: sort out True/False/boolean issues for Python 2.3
"""
An XML-RPC client interface for Python.
...
...
@@ -120,8 +115,7 @@ Exported classes:
Exported constants:
True
False
(none)
Exported functions:
...
...
@@ -133,7 +127,8 @@ Exported functions:
name (None if not present).
"""
import
re
,
time
,
operator
import
base64
import
time
import
http.client
from
xml.parsers
import
expat
import
socket
...
...
@@ -230,7 +225,7 @@ class ResponseError(Error):
##
# Indicates an XML-RPC fault response package. This exception is
# raised by the unmarshalling layer, if the XML-RPC response contains
# a fault string. This exception can also used as a class, to
# a fault string. This exception can also
be
used as a class, to
# generate a fault XML-RPC message.
#
# @param faultCode The XML-RPC fault code.
...
...
@@ -243,10 +238,7 @@ class Fault(Error):
self
.
faultCode
=
faultCode
self
.
faultString
=
faultString
def
__repr__
(
self
):
return
(
"<Fault %s: %s>"
%
(
self
.
faultCode
,
repr
(
self
.
faultString
))
)
return
"<Fault %s: %r>"
%
(
self
.
faultCode
,
self
.
faultString
)
# --------------------------------------------------------------------
# Special values
...
...
@@ -352,7 +344,7 @@ class DateTime:
return
self
.
value
def
__repr__
(
self
):
return
"<DateTime %
s at %x>"
%
(
repr
(
self
.
value
)
,
id
(
self
))
return
"<DateTime %
r at %x>"
%
(
self
.
value
,
id
(
self
))
def
decode
(
self
,
data
):
self
.
value
=
str
(
data
).
strip
()
...
...
@@ -378,9 +370,6 @@ def _datetime_type(data):
#
# @param data An 8-bit string containing arbitrary data.
import
base64
import
io
class
Binary
:
"""Wrapper for binary data."""
...
...
@@ -1198,7 +1187,6 @@ class Transport:
auth
,
host
=
urllib
.
parse
.
splituser
(
host
)
if
auth
:
import
base64
auth
=
urllib
.
parse
.
unquote_to_bytes
(
auth
)
auth
=
base64
.
encodebytes
(
auth
).
decode
(
"utf-8"
)
auth
=
""
.
join
(
auth
.
split
())
# get rid of whitespace
...
...
Lib/xmlrpc/server.py
View file @
c4fec937
...
...
@@ -329,7 +329,6 @@ class SimpleXMLRPCDispatcher:
if
method
is
None
:
return
""
else
:
import
pydoc
return
pydoc
.
getdoc
(
method
)
def
system_multicall
(
self
,
call_list
):
...
...
@@ -560,7 +559,7 @@ class SimpleXMLRPCServer(socketserver.TCPServer,
Simple XML-RPC server that allows functions and a single instance
to be installed to handle requests. The default implementation
attempts to dispatch XML-RPC calls to the functions or instance
installed in the server. Override the _dispatch method inher
e
ted
installed in the server. Override the _dispatch method inher
i
ted
from SimpleXMLRPCDispatcher to change this behavior.
"""
...
...
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