[Python-Dev] 64-bit values in XML RPC: OverflowError: int exceeds XML-RPC limits

Peter Hanecak peter.hanecak at alcatel-lucent.sk
Wed Jul 15 15:46:59 CEST 2009


Hello,

when I'm trying to use 64-bit integer values with SimpleXMLRPCServer, 
I'm getting "OverflowError: int exceeds XML-RPC limits" error each time 
I use an integer with value greater or equal to 2^31.

I googled this:

	http://bugs.python.org/issue2985


So, my question is: In which Python release has been this fix distributed?

Thank you in advance for information.

Btw, I've made some dummy scripts to demonstrate the issue:

- server.py:
from SimpleXMLRPCServer import SimpleXMLRPCServer

def dummy(number):
   return number

server = SimpleXMLRPCServer(("localhost", 8000))
server.register_function(dummy, 'dummy')
server.serve_forever()

- client.py
import xmlrpclib

proxy = xmlrpclib.ServerProxy("http://localhost:8000/")
print proxy.dummy(0x7FFFFFFF)
print proxy.dummy(0x80000000)


The output from client is:
localhost.localdomain - - [15/Jul/2009 15:24:12] "POST / HTTP/1.0" 200 -
2147483647
Traceback (most recent call last):
   File "./client.py", line 7, in <module>
     print proxy.dummy(0x80000000)
   File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
     return self.__send(self.__name, args)
   File "/usr/lib64/python2.6/xmlrpclib.py", line 1483, in __request
     allow_none=self.__allow_none)
   File "/usr/lib64/python2.6/xmlrpclib.py", line 1132, in dumps
     data = m.dumps(params)
   File "/usr/lib64/python2.6/xmlrpclib.py", line 677, in dumps
     dump(v, write)
   File "/usr/lib64/python2.6/xmlrpclib.py", line 699, in __dump
     f(self, value, write)
   File "/usr/lib64/python2.6/xmlrpclib.py", line 710, in dump_int
     raise OverflowError, "int exceeds XML-RPC limits"
OverflowError: int exceeds XML-RPC limits


Have a nice day.

Peter

p.s.: I'm not subscribed to the list, se please keep me in CC when 
replying. Thank you.

-- 
Peter Hanecak

ePC Developer | Alcatel-Lucent
Apollo BC II - B block | Prievozska 4/A 11 | Bratislava | Slovak Republic
email: peter.hanecak at alcatel-lucent.com
phone: +421 (0)2 49264 857


More information about the Python-Dev mailing list