summaryrefslogtreecommitdiffstats
path: root/Lib/xmlrpc/client.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2011-10-30 19:39:24 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2011-10-30 19:39:24 (GMT)
commit75861df9ab2b5492406ce866f5a24989a00a24b9 (patch)
treef6823a412379e5d9c91c612a8662652fc20cd3b4 /Lib/xmlrpc/client.py
parent2b6403e5d14a407acb744cd1da58d1a66c412050 (diff)
downloadcpython-75861df9ab2b5492406ce866f5a24989a00a24b9.zip
cpython-75861df9ab2b5492406ce866f5a24989a00a24b9.tar.gz
cpython-75861df9ab2b5492406ce866f5a24989a00a24b9.tar.bz2
Fix User-Agent for the xmlrpc.client, and catch KeyboardInterrupt for the standalone xmlrpc.server.
Diffstat (limited to 'Lib/xmlrpc/client.py')
-rw-r--r--Lib/xmlrpc/client.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py
index 496b2b5..57e987b 100644
--- a/Lib/xmlrpc/client.py
+++ b/Lib/xmlrpc/client.py
@@ -128,6 +128,7 @@ Exported functions:
"""
import base64
+import sys
import time
import http.client
from xml.parsers import expat
@@ -152,7 +153,8 @@ def escape(s):
s = s.replace("<", "&lt;")
return s.replace(">", "&gt;",)
-__version__ = "1.0.1"
+# used in User-Agent header sent
+__version__ = sys.version[:3]
# xmlrpc integer limits
MAXINT = 2**31-1
@@ -408,7 +410,6 @@ class Binary:
out.write("<value><base64>\n")
encoded = base64.encodebytes(self.data)
out.write(encoded.decode('ascii'))
- out.write('\n')
out.write("</base64></value>\n")
def _binary(data):
@@ -1079,7 +1080,7 @@ class Transport:
"""Handles an HTTP transaction to an XML-RPC server."""
# client identifier (may be overridden)
- user_agent = "xmlrpclib.py/%s (by www.pythonware.com)" % __version__
+ user_agent = "Python-xmlrpc/%s" % __version__
#if true, we'll request gzip encoding
accept_gzip_encoding = True