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

Add parsing support for more types in xmlrpc #71072

Closed
serhiy-storchaka opened this issue Apr 29, 2016 · 5 comments
Closed

Add parsing support for more types in xmlrpc #71072

serhiy-storchaka opened this issue Apr 29, 2016 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Apr 29, 2016

BPO 26885
Nosy @loewis, @terryjreedy, @serhiy-storchaka
Dependencies
  • bpo-26873: xmlrpclib raises when trying to convert an int to string when unicode is available
  • Files
  • xmlrpc_extensions.patch
  • xmlrpc_extensions2.patch
  • 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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2016-09-13.06:30:07.422>
    created_at = <Date 2016-04-29.15:33:03.745>
    labels = ['type-feature', 'library']
    title = 'Add parsing support for more types in xmlrpc'
    updated_at = <Date 2016-09-13.06:30:07.421>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2016-09-13.06:30:07.421>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2016-09-13.06:30:07.422>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2016-04-29.15:33:03.745>
    creator = 'serhiy.storchaka'
    dependencies = ['26873']
    files = ['42652', '42765']
    hgrepos = []
    issue_num = 26885
    keywords = ['patch']
    message_count = 5.0
    messages = ['264504', '265045', '267053', '269700', '275745']
    nosy_count = 4.0
    nosy_names = ['loewis', 'terry.reedy', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue26885'
    versions = ['Python 3.6']

    @serhiy-storchaka
    Copy link
    Member Author

    serhiy-storchaka commented Apr 29, 2016

    Apache XML-RPC server supports additional data types (http://ws.apache.org/xmlrpc/types.html). Proposed patch adds support of parsing some of these types: "ex:nil", "ex:i1", "ex:i2", "ex:i8", "ex:biginteger", "ex:float", "ex:bigdecimal". "nil" and "i8" without a prefix was already supported, but the support of "i8" was not documented.

    The support of "ex:dateTime" can be added after resolving bpo-15873.

    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Apr 29, 2016
    @serhiy-storchaka
    Copy link
    Member Author

    serhiy-storchaka commented May 7, 2016

    Updated documentation.

    Terry, could you please look at the documentation. Is it good English or needed a correction?

    @terryjreedy
    Copy link
    Member

    terryjreedy commented Jun 3, 2016

    Table: I believe the format is that the second column describes Pyhton objects that can be marshalled into xml for the rpc. Sometimes a note is added about the 'return' type, which I presume is the Python object unmarshalled from xml. From this standpoint,
    ":class:`int` in range from -2147483648 to 2147483647."
    is correct, as well as clearer than the replacement.

    I presume 'tags' are in the xml. "Tag' is meaningless for the returned Python objects. To me "Values get the <int> tag." is more grammatical and at least as clear.

    ---
    +The module now supports unmarshalling additional data types used by
    +Apache XML-RPC implementation for numerics and None.

    The following is clearer to me, although I am puzzled as the table entry for 'nil' in unchanged.

    +The module now supports unmarshalling None and additional data
    +types used by Apache XML-RPC implementation for numerics.

    @serhiy-storchaka
    Copy link
    Member Author

    serhiy-storchaka commented Jul 1, 2016

    Thank you for your review Terry.

    You can pass an integer in range from -2147483648 to 2147483647, and it is marshalled using the <int> tag. But when you receive tags <i1>, <i2>, etc, they are unmarshalled to integer values, and these values can be out of range from -2147483648 to 2147483647. How to document all these detail in short?

    The same is with other types. xmlrpclib is more conservative with data that it sends than with data that it receives. float is marshalled using the <double> flag, but the <float> tag is unmarshalled to float too. None and datetime can be marshalled only if corresponding option is enabled, but always can be unmarshalled. Decimal can't be marshalled, but can be unmarshalled.

    For now unmarshalling None is supported from the <nil> tag (this is unofficial extension). But Apache XML-RPC server produces tags with namespace: <ex:nil>, which is not supported in xmplrpclib. The patch adds the support of tags with namespaces, and therefore adds the support of unmarshalling None in Apache XML-RPC server format.

    @serhiy-storchaka serhiy-storchaka self-assigned this Sep 10, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 11, 2016

    New changeset ef63e1c999bd by Serhiy Storchaka in branch 'default':
    Issue bpo-26885: xmlrpc now supports unmarshalling additional data types used
    https://hg.python.org/cpython/rev/ef63e1c999bd

    @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 type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants