Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmlrpclib doesn't support 64bit integer replies #47234

Closed
shrike mannequin opened this issue May 27, 2008 · 8 comments
Closed

xmlrpclib doesn't support 64bit integer replies #47234

shrike mannequin opened this issue May 27, 2008 · 8 comments
Labels
stdlib Python modules in the Lib dir

Comments

@shrike
Copy link
Mannequin

shrike mannequin commented May 27, 2008

BPO 2985
Nosy @birkenfeld
Files
  • xmlrpclib-64bitsupport.diff: Patch to add support for 64 bit integers
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2008-05-29.07:45:36.415>
    created_at = <Date 2008-05-27.19:26:48.962>
    labels = ['library']
    title = "xmlrpclib doesn't support 64bit integer replies"
    updated_at = <Date 2008-05-30.12:21:36.473>
    user = 'https://bugs.python.org/shrike'

    bugs.python.org fields:

    activity = <Date 2008-05-30.12:21:36.473>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-05-29.07:45:36.415>
    closer = 'georg.brandl'
    components = ['Library (Lib)']
    creation = <Date 2008-05-27.19:26:48.962>
    creator = 'shrike'
    dependencies = []
    files = ['10450']
    hgrepos = []
    issue_num = 2985
    keywords = ['patch']
    message_count = 8.0
    messages = ['67426', '67427', '67461', '67462', '67476', '67483', '67485', '67531']
    nosy_count = 3.0
    nosy_names = ['georg.brandl', 'schmir', 'shrike']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue2985'
    versions = ['Python 2.5']

    @shrike
    Copy link
    Mannequin Author

    shrike mannequin commented May 27, 2008

    When querying a XML-RPC server that returns a 64 bit integer, the python
    interface always returns an empty tuple.

    When running with verbose=True the response is still intact, the library
    just can't parse the result between the <i8></i8> tags.

    Example response:
    body: '<?xml version="1.0"
    encoding="UTF-8"?>\r\n<methodResponse>\r\n<params>\r\n<param><value><i8>1157</i8></value></param>\r\n</params>\r\n</methodResponse>\r\n'

    @shrike shrike mannequin added the stdlib Python modules in the Lib dir label May 27, 2008
    @shrike
    Copy link
    Mannequin Author

    shrike mannequin commented May 27, 2008

    I attached a patch that seems to fix the problem, needs proper testing
    though.

    @schmir
    Copy link
    Mannequin

    schmir mannequin commented May 28, 2008

    which implementations do support those 64 bit integers?

    @shrike
    Copy link
    Mannequin Author

    shrike mannequin commented May 28, 2008

    I ran into 64bit integer responses with rtorrent's XML-RPC API.

    @birkenfeld
    Copy link
    Member

    Thanks, fixed in r63782.

    @schmir
    Copy link
    Mannequin

    schmir mannequin commented May 29, 2008

    I think it's also a bug that xmlrpclib just ignores unknown tags
    (without even printing a warning).

    and: wouldn't it be nice if we could also write back those integers?

    >>> import xmlrpclib
    >>> xmlrpclib.dumps((2**40,))
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/ralf/pydev/trunk/Lib/xmlrpclib.py", line 1126, in dumps
    data = m.dumps(params)
      File "/home/ralf/pydev/trunk/Lib/xmlrpclib.py", line 671, in dumps
    dump(v, write)
      File "/home/ralf/pydev/trunk/Lib/xmlrpclib.py", line 693, in __dump
    f(self, value, write)
      File "/home/ralf/pydev/trunk/Lib/xmlrpclib.py", line 704, in dump_int
    raise OverflowError, "int exceeds XML-RPC limits"
    OverflowError: int exceeds XML-RPC limits

    I asked about the implementations supporting this as this i8 tag does
    not conform to the xmlrpc spec (but I would be happy if there was an de
    facto standard for sending large integers and would also help implement it).

    @shrike
    Copy link
    Mannequin Author

    shrike mannequin commented May 29, 2008

    The I8 tag is an extension by xmlrpc-c:
    http://xmlrpc-c.sourceforge.net/doc/libxmlrpc.html#extensiontype
    (XMLRPC_TYPE_I8)

    @birkenfeld
    Copy link
    Member

    As long as long integers aren't in the official spec, the current status
    is fine - liberal in accepting, and strict in sending.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant