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

xml.parsers.expat.(errors|model) don't set the __loader__ attribute #61318

Closed
brettcannon opened this issue Feb 3, 2013 · 4 comments
Closed
Assignees
Labels
easy type-bug An unexpected behavior, bug, or error

Comments

@brettcannon
Copy link
Member

BPO 17116
Nosy @brettcannon
Dependencies
  • bpo-17115: loader = None should be fine
  • Files
  • python-issue-17116.diff: simple patch that sets the __loader__s of errors and model modules of pyexpat to None
  • 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/brettcannon'
    closed_at = <Date 2013-05-04.17:58:17.289>
    created_at = <Date 2013-02-03.16:47:37.026>
    labels = ['easy', 'type-bug']
    title = "xml.parsers.expat.(errors|model) don't set the __loader__ attribute"
    updated_at = <Date 2013-05-04.17:58:17.288>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2013-05-04.17:58:17.288>
    actor = 'brett.cannon'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2013-05-04.17:58:17.289>
    closer = 'brett.cannon'
    components = []
    creation = <Date 2013-02-03.16:47:37.026>
    creator = 'brett.cannon'
    dependencies = ['17115']
    files = ['29186']
    hgrepos = []
    issue_num = 17116
    keywords = ['patch', 'easy']
    message_count = 4.0
    messages = ['181280', '182773', '182887', '188383']
    nosy_count = 2.0
    nosy_names = ['brett.cannon', 'gkcn']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue17116'
    versions = ['Python 3.4']

    @brettcannon
    Copy link
    Member Author

    A new test in test_importlib is discovering that pyexpat is creating both its errors and model modules by hand in pyexpat's initialization function. Should at least set __loader__ to None there.

    @brettcannon brettcannon self-assigned this Feb 3, 2013
    @brettcannon brettcannon added type-bug An unexpected behavior, bug, or error easy labels Feb 3, 2013
    @gkcn
    Copy link
    Mannequin

    gkcn mannequin commented Feb 23, 2013

    Should this be done in Modules/pyexpat.c file or in Lib/xml/parsers/expat.py? If modifying expat.py is sufficient, then attached simple patch does the job. By the way I couldn't find the test you are referring to. Is it in Lib/test/test_importlib of somewhere else?

    @brettcannon
    Copy link
    Member Author

    The comment is out of date; I removed the test because it was constantly failing.

    As for the patch, it looks correct, but I plan to make a change to Python so that __loader__ is set by default (see the dependent issue bpo-17115). If I don't get to that change I will commit the patch, else it will implicitly get fixed.

    @brettcannon
    Copy link
    Member Author

    New changeset e39a8f8ceb9f by Brett Cannon in branch 'default':
    bpo-17115,17116: Have modules initialize the __package__ and __loader__
    http://hg.python.org/cpython/rev/e39a8f8ceb9f

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

    No branches or pull requests

    1 participant