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

Installing sgmlop causes xmlrpclib error #48963

Closed
Cito mannequin opened this issue Dec 21, 2008 · 4 comments
Closed

Installing sgmlop causes xmlrpclib error #48963

Cito mannequin opened this issue Dec 21, 2008 · 4 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@Cito
Copy link
Mannequin

Cito mannequin commented Dec 21, 2008

BPO 4713
Nosy @akuchling, @Cito, @briancurtin
Files
  • xmlrpclib.patch: Patch for Issue4713
  • 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 2016-11-06.20:57:44.307>
    created_at = <Date 2008-12-21.21:30:06.077>
    labels = ['type-bug', 'library']
    title = 'Installing sgmlop causes xmlrpclib error'
    updated_at = <Date 2016-11-06.20:57:44.305>
    user = 'https://github.com/Cito'

    bugs.python.org fields:

    activity = <Date 2016-11-06.20:57:44.305>
    actor = 'akuchling'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-11-06.20:57:44.307>
    closer = 'akuchling'
    components = ['Library (Lib)']
    creation = <Date 2008-12-21.21:30:06.077>
    creator = 'cito'
    dependencies = []
    files = ['12418']
    hgrepos = []
    issue_num = 4713
    keywords = ['patch', 'needs review']
    message_count = 4.0
    messages = ['78156', '99131', '166220', '280172']
    nosy_count = 4.0
    nosy_names = ['akuchling', 'cito', 'brian.curtin', 'bcroq']
    pr_nums = []
    priority = 'normal'
    resolution = 'works for me'
    stage = 'test needed'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue4713'
    versions = ['Python 2.6']

    @Cito
    Copy link
    Mannequin Author

    Cito mannequin commented Dec 21, 2008

    If you install sgmlop (downloadable from
    http://effbot.org/downloads/#sgmlop) under Python 2.x, then this can
    break xmlrpclib.

    You can reproduce this problem as follows (I have tested with Py 2.4,
    2.5 and 2.6):

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

    data = """<?xml version="1.0" encoding="UTF-8"?>
    <methodCall><methodName>f</methodName><params>
    <param><value>k&#228;se</value></param>
    </params></methodCall>"""
    
    import xmlrpclib

    assert xmlrpclib.FastParser is None
    print xmlrpclib.SgmlopParser and 'with' or 'without', 'sgmlop'

    assert xmlrpclib.loads(data) == ((u'k\xe4se',), 'f')

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

    If sgmlop is installed, this gives a UnicodeDecodeError, otherwise
    everything works well.

    This happens because xmlrpclib prefers using sgmlop over
    lib.parsers.expat, but fails to handle numeric character entities
    properly with this parser.

    Find attached a patch that fixes this problem.

    I also wonder whether lib.parsers.expat shouldn't be preferred over
    sgmlop, since the latter is somewhat outdated, and installing external
    libraries should not cause crashes or wrong behavior of standard lib
    modules (see also bpo-1772916 for a similar problem).

    @Cito Cito mannequin added type-crash A hard crash of the interpreter, possibly with a core dump stdlib Python modules in the Lib dir labels Dec 21, 2008
    @briancurtin briancurtin added type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Feb 9, 2010
    @briancurtin
    Copy link
    Member

    The patch could use a test (which doesn't require sgmlop).

    @briancurtin briancurtin changed the title Installing sgmlop can crash xmlrpclib Installing sgmlop causes xmlrpclib error Feb 9, 2010
    @bcroq
    Copy link
    Mannequin

    bcroq mannequin commented Jul 23, 2012

    This bug still present in Python 2.7, the proposed patch works.

    @akuchling
    Copy link
    Member

    I don't believe this bug is still present in Python 2.7. Issue bpo-5767 removed sgmlop support from xmlrpclib in 2.7 alpha 1, and trying the test program succeeds. Closing.

    @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-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants