cpython: 013d2881beb5 (original) (raw)
Mercurial > cpython
changeset 73215:013d2881beb5 3.2
Issue #13293: Better error message when trying to marshal bytes using xmlrpc.client. [#13293]
Florent Xicluna florent.xicluna@gmail.com | |
---|---|
date | Sun, 30 Oct 2011 20:22:25 +0100 |
parents | e88e7ef6b53d |
children | 908791916611 d60e48cae52d |
files | Lib/xmlrpc/client.py Misc/NEWS |
diffstat | 2 files changed, 4 insertions(+), 9 deletions(-)[+] [-] Lib/xmlrpc/client.py 10 Misc/NEWS 3 |
line wrap: on
line diff
--- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -503,9 +503,7 @@ class Marshaller: f = self.dispatch[type(value)] except KeyError: # check if this object can be marshalled as a structure
try:[](#l1.7)
value.__dict__[](#l1.8)
except:[](#l1.9)
if not hasattr(value, '__dict__'):[](#l1.10) raise TypeError("cannot marshal %s objects" % type(value))[](#l1.11) # check if this class is a sub-class of a basic type,[](#l1.12) # because we don't know how to marshal these types[](#l1.13)
@@ -553,12 +551,6 @@ class Marshaller: write("\n") dispatch[float] = dump_double
- def dump_string(self, value, write, escape=escape):
write("<value><string>")[](#l1.19)
write(escape(value))[](#l1.20)
write("</string></value>\n")[](#l1.21)
- dispatch[bytes] = dump_string
- def dump_unicode(self, value, write, escape=escape): write("") write(escape(value))
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -63,6 +63,9 @@ Core and Builtins Library ------- +- Issue #13293: Better error message when trying to marshal bytes using