[Patches] [ python-Patches-468394 ] Allow xmlrpclib to handle long ints
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 05 Oct 2001 13:24:49 -0700
Patches item #468394, was opened at 2001-10-05 13:23
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=468394&group_id=5470
Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Nobody/Anonymous (nobody)
Summary: Allow xmlrpclib to handle long ints
Initial Comment:
xmlrpclib currently raises an exception when passed a long int, even if it int(N) doesn't raise OverflowError. The attached patch adds a dump_long method to the Marshaller class. It makes no attempt to recover from an out-of-range long, letting the user catch the resulting OverflowError.
----------------------------------------------------------------------
>Comment By: Skip Montanaro (montanaro)
Date: 2001-10-05 13:24
Message:
Logged In: YES
user_id=44345
Damn... Something seems amiss with Opera's file upload capability. It's a short patch, included here:
*** /tmp/skip/xmlrpclib.py.~1.11~ Fri Oct 5 15:14:45 2001
--- /tmp/skip/xmlrpclib.py Fri Oct 5 15:14:45 2001
***************
*** 464,469 ****
--- 464,474 ----
self.write("<value><int>%s</int></value>\n" % value)
dispatch[IntType] = dump_int
+ def dump_long(self, value):
+ val = int(value)
+ self.write("<value><int>%s</int></value>\n" % val)
+ dispatch[LongType] = dump_long
+
def dump_double(self, value):
self.write("<value><double>%s</double></value>\n" % value)
dispatch[FloatType] = dump_double
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=468394&group_id=5470