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

Update importlib.util.module_for_loader/set_loader to set when __loader__ = None #61319

Closed
brettcannon opened this issue Feb 3, 2013 · 9 comments
Assignees
Labels
easy stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@brettcannon
Copy link
Member

BPO 17117
Nosy @brettcannon, @ericsnowcurrently
Files
  • python-issue-17117.diff: Patch that changes the way loader attribute is checked
  • 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-03-13.18:12:09.611>
    created_at = <Date 2013-02-03.16:49:34.534>
    labels = ['easy', 'type-bug', 'library']
    title = 'Update importlib.util.module_for_loader/set_loader to set when __loader__ = None'
    updated_at = <Date 2013-03-13.18:12:09.609>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2013-03-13.18:12:09.609>
    actor = 'brett.cannon'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2013-03-13.18:12:09.611>
    closer = 'brett.cannon'
    components = ['Library (Lib)']
    creation = <Date 2013-02-03.16:49:34.534>
    creator = 'brett.cannon'
    dependencies = []
    files = ['29177']
    hgrepos = []
    issue_num = 17117
    keywords = ['patch', 'easy']
    message_count = 9.0
    messages = ['181281', '181357', '182755', '182884', '182886', '182888', '182889', '184094', '184099']
    nosy_count = 4.0
    nosy_names = ['brett.cannon', 'python-dev', 'eric.snow', 'gkcn']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'test needed'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue17117'
    versions = ['Python 3.4']

    @brettcannon
    Copy link
    Member Author

    The various importlib.util decorators involved with __loader__ should reset the attribute when it is set to None, just like for __package__.

    @brettcannon brettcannon self-assigned this Feb 3, 2013
    @brettcannon brettcannon added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error easy labels Feb 3, 2013
    @ericsnowcurrently
    Copy link
    Member

    +1

    @gkcn
    Copy link
    Mannequin

    gkcn mannequin commented Feb 23, 2013

    The patch is attached. Is it correct?

    @brettcannon
    Copy link
    Member Author

    Yep, the patch looks right, Gökcen! If you want to update the tests and docs that would be great, but obviously don't feel obliged to.

    @gkcn
    Copy link
    Mannequin

    gkcn mannequin commented Feb 24, 2013

    Of course. I have also commented on issue#17116 but I couldn't find the pyexpat test you mentioned. I would like to fix bpo-17116 and bpo-17115

    @brettcannon
    Copy link
    Member Author

    Issue bpo-17116 will be fixed by issue bpo-17715 if you decide to tackle it. That bug will require C-level changes to the module type; just FYI.

    Please consider a PSF contributor form, Gökcen, if you plan to continue to submit code (your importlib.util fixes are simple enough to not require anything yet, but tests added to that plus anything you do for issue bpo-17115 will require the form in order for me to commit your code). Instructions can be found at http://www.python.org/psf/contrib/ .

    And obviously thanks for taking a look at all of this!

    @gkcn
    Copy link
    Mannequin

    gkcn mannequin commented Feb 24, 2013

    I have already given my form to akheron during a Python sprint, I think he will submit it to PSF within a few days.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 13, 2013

    New changeset 7647aae9481c by Brett Cannon in branch 'default':
    Issue bpo-17117: Have both import itself and importlib.util.set_loader()
    http://hg.python.org/cpython/rev/7647aae9481c

    @brettcannon
    Copy link
    Member Author

    Thanks for the patch, Gökcen! Added you the Misc/ACKS.

    @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 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