This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skip.montanaro
Recipients
Date 2001-10-10.19:36:46
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Maybe xmlrpclib should be modified to allow it to marshal subclasses of builtin types (ints, strings, etc).  Here's a simple example that demonstrates that it currently won't work with a subclass of str:

>>> import xmlrpclib
>>> class MyString(str):
...   pass
... 
>>> s = MyString("sdfsdfsdf")
>>> s
'sdfsdfsdf'
>>> s.__class__
<class '__main__.MyString'>
>>> xmlrpclib.dumps((s,))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.2/xmlrpclib.py", line 752, in dumps
    data = m.dumps(params)
  File "/usr/local/lib/python2.2/xmlrpclib.py", line 448, in dumps
    self.__dump(v)
  File "/usr/local/lib/python2.2/xmlrpclib.py", line 459, in __dump
    raise TypeError, "cannot marshal %s objects" % type(value)
TypeError: cannot marshal <class '__main__.MyString'> objects
History
Date User Action Args
2007-08-23 13:56:45adminlinkissue469972 messages
2007-08-23 13:56:45admincreate