Commit 93dfee1d authored by Florent Xicluna's avatar Florent Xicluna

Issue #13293: Better error message when trying to marshal bytes using xmlrpc.client.

parent c4fec937
...@@ -503,9 +503,7 @@ class Marshaller: ...@@ -503,9 +503,7 @@ class Marshaller:
f = self.dispatch[type(value)] f = self.dispatch[type(value)]
except KeyError: except KeyError:
# check if this object can be marshalled as a structure # check if this object can be marshalled as a structure
try: if not hasattr(value, '__dict__'):
value.__dict__
except:
raise TypeError("cannot marshal %s objects" % type(value)) raise TypeError("cannot marshal %s objects" % type(value))
# check if this class is a sub-class of a basic type, # check if this class is a sub-class of a basic type,
# because we don't know how to marshal these types # because we don't know how to marshal these types
...@@ -553,12 +551,6 @@ class Marshaller: ...@@ -553,12 +551,6 @@ class Marshaller:
write("</double></value>\n") write("</double></value>\n")
dispatch[float] = dump_double dispatch[float] = dump_double
def dump_string(self, value, write, escape=escape):
write("<value><string>")
write(escape(value))
write("</string></value>\n")
dispatch[bytes] = dump_string
def dump_unicode(self, value, write, escape=escape): def dump_unicode(self, value, write, escape=escape):
write("<value><string>") write("<value><string>")
write(escape(value)) write(escape(value))
......
...@@ -63,6 +63,9 @@ Core and Builtins ...@@ -63,6 +63,9 @@ Core and Builtins
Library Library
------- -------
- Issue #13293: Better error message when trying to marshal bytes using
xmlrpc.client.
- Issue #13291: NameError in xmlrpc package. - Issue #13291: NameError in xmlrpc package.
- Issue #13258: Use callable() built-in in the standard library. - Issue #13258: Use callable() built-in in the standard library.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment