[Patches] [ python-Patches-468394 ] Allow xmlrpclib to handle long ints

noreply@sourceforge.net noreply@sourceforge.net
Thu, 18 Oct 2001 18:53:45 -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: Closed
Resolution: Accepted
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Skip Montanaro (montanaro)
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: Guido van Rossum (gvanrossum)
Date: 2001-10-18 18:53

Message:
Logged In: YES 
user_id=6380

Looks like (something like) this was committed, so I'll
close this.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2001-10-09 01:48

Message:
Logged In: YES 
user_id=21627

When committing the patch, please add a line to the 
History: in the file


----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2001-10-09 00:42

Message:
Logged In: YES 
user_id=21627

The patch looks good to me. Please apply it.


----------------------------------------------------------------------

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