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

SimpleXMLRPCDispatcher._dispatch mangles tracebacks when invoking RPC calls through _dispatch #73801

Closed
petr-motejlek mannequin opened this issue Feb 21, 2017 · 4 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@petr-motejlek
Copy link
Mannequin

petr-motejlek mannequin commented Feb 21, 2017

BPO 29615
Nosy @loewis, @serhiy-storchaka, @petr-motejlek
PRs
  • bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other exception) to exception(s) raised in the dispatched methods. #260
  • [3.6] bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other exception) to exception(s) raised in the dispatched methods. #478
  • [3.5] bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other exception) to exception(s) raised in the dispatched methods. #479
  • [Do Not Merge] Sample of CPython life with blurb. #703
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • 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 2017-03-17.21:13:55.521>
    created_at = <Date 2017-02-21.20:30:25.353>
    labels = ['3.7', 'type-bug', 'library']
    title = 'SimpleXMLRPCDispatcher._dispatch mangles tracebacks when invoking RPC calls through _dispatch'
    updated_at = <Date 2017-03-31.16:36:09.952>
    user = 'https://github.com/petr-motejlek'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:09.952>
    actor = 'dstufft'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-03-17.21:13:55.521>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2017-02-21.20:30:25.353>
    creator = 'petr@motejlek.net'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 29615
    keywords = []
    message_count = 4.0
    messages = ['288319', '290297', '290298', '290351']
    nosy_count = 3.0
    nosy_names = ['loewis', 'serhiy.storchaka', 'petr@motejlek.net']
    pr_nums = ['260', '478', '479', '703', '552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue29615'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    @petr-motejlek
    Copy link
    Mannequin Author

    petr-motejlek mannequin commented Feb 21, 2017

    Hello,

    We discovered that SimpleXMLRPCDispatcher mangles tracebacks printed from within the invoked RPC methods when an object that has _dispatch(method, params) defined has been registered with it

    Steps to reproduce

    The reason for this is that SimpleXMLRPCDispatcher._dispatch first attempts to acquire the function to invoke by reading from the functions registered with the dispatcher. When this attempt fails, KeyError is raised. During its handling different approaches are taken to acquire the function and for all but one when the function is acquired, handling of the KeyError ends and the function is called properly, outside of the except block

    However, in the case of objects that define the _dispatch(method, params) function, the _dispatch(method, params) function is called straight away, still within the except block handling the KeyError, and this leads to the mangled traceback

    This behavior is neither documented, nor expected (we believe) and thus the code should be changed

    Will submit a PR (incl. tests) for this later on

    @petr-motejlek petr-motejlek mannequin added 3.7 (EOL) end of life stdlib Python modules in the Lib dir labels Feb 21, 2017
    @serhiy-storchaka serhiy-storchaka added the type-bug An unexpected behavior, bug, or error label Feb 24, 2017
    @serhiy-storchaka
    Copy link
    Member

    New changeset c6e199f by Serhiy Storchaka (Petr Motejlek) in branch '3.5':
    bpo-29615: backport to 3.5 (#479)
    c6e199f

    @serhiy-storchaka
    Copy link
    Member

    New changeset 3405792 by Serhiy Storchaka (Petr Motejlek) in branch '3.6':
    bpo-29615: backport to 3.6 (#478)
    3405792

    @serhiy-storchaka
    Copy link
    Member

    New changeset 3c6314c by Serhiy Storchaka (Petr Motejlek) in branch 'master':
    bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (#260)
    3c6314c

    @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
    3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant