[ python-Bugs-1164912 ] xmlrpclib.DateTime.decode() should
stringify argument
SourceForge.net
noreply at sourceforge.net
Thu Mar 17 01:27:33 CET 2005
Bugs item #1164912, was opened at 2005-03-16 16:27
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1164912&group_id=5470
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Allan Saddi (asaddi)
Assigned to: Nobody/Anonymous (nobody)
Summary: xmlrpclib.DateTime.decode() should stringify argument
Initial Comment:
DateTime.decode() is allowing unicode strings to be assigned to
self.value.
Python 2.4 (#2, Feb 17 2005, 09:44:14)
[GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> from xmlrpclib import *
>>> s = loads(dumps((DateTime(),), methodresponse=True))
>>> print s
((<DateTime u'20050316T16:10:20' at 81ca38c>,), None)
When this DateTime object with unicode value is subsequently
passed to dumps(), dumps() will either return the result as a unicode
string (which I don't believe is the correct behavior), or it will raise a
UnicodeDecodeError.
>>> dumps(s[0])
u'<params>\n<param>\n<value><dateTime.iso8601>20050316T16:
10:20</dateTime.iso8601></value>\n</param>\n</params>\n'
(UnicodeDecodeError is raised when marshalling other unicode
strings that do not have a simple ascii representation with the
resultant DateTime.)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1164912&group_id=5470
More information about the Python-bugs-list
mailing list