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

imp.new_module does not function correctly if the module is returned from a function and used directly #51389

Closed
jkp mannequin opened this issue Oct 15, 2009 · 7 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@jkp
Copy link
Mannequin

jkp mannequin commented Oct 15, 2009

BPO 7140
Nosy @terryjreedy, @pitrou, @benjaminp
Superseder
  • bpo-18214: Stop purging modules which are garbage collected before shutdown
  • Files
  • testcase.py: Testcase demonstrating the issue.
  • testcase.py
  • 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 2013-07-31.09:36:01.655>
    created_at = <Date 2009-10-15.11:24:51.053>
    labels = ['type-bug', 'library']
    title = 'imp.new_module does not function correctly if the module is returned from a function and used directly'
    updated_at = <Date 2013-07-31.09:36:01.653>
    user = 'https://bugs.python.org/jkp'

    bugs.python.org fields:

    activity = <Date 2013-07-31.09:36:01.653>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-07-31.09:36:01.655>
    closer = 'pitrou'
    components = ['Library (Lib)']
    creation = <Date 2009-10-15.11:24:51.053>
    creator = 'jkp'
    dependencies = []
    files = ['15133', '15134']
    hgrepos = []
    issue_num = 7140
    keywords = []
    message_count = 7.0
    messages = ['94082', '94083', '94095', '118480', '118819', '121213', '193992']
    nosy_count = 5.0
    nosy_names = ['terry.reedy', 'pitrou', 'benjamin.peterson', 'jkp', 'Arfrever']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '18214'
    type = 'behavior'
    url = 'https://bugs.python.org/issue7140'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    @jkp
    Copy link
    Mannequin Author

    jkp mannequin commented Oct 15, 2009

    See the testcase included. If you instead assign the result of the
    get_module() call to a variable and then make the call to the function
    defined in that module it works as expected.

    @jkp jkp mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Oct 15, 2009
    @jkp
    Copy link
    Mannequin Author

    jkp mannequin commented Oct 15, 2009

    Updated the testcase to show that the __dict__ for the module is incorrect
    unless the module is assigned to a temp variable.

    @benjaminp
    Copy link
    Contributor

    Fixed in r75437.

    @benjaminp
    Copy link
    Contributor

    Rebroken in r85392. See bpo-10068.

    @benjaminp benjaminp reopened this Oct 12, 2010
    @terryjreedy
    Copy link
    Member

    Since that revision only touched py3k, I am guessing that it only broke 3.2.

    @Arfrever
    Copy link
    Mannequin

    Arfrever mannequin commented Nov 15, 2010

    But there were r85393 (2.7) and r85394 (3.1).

    @pitrou
    Copy link
    Member

    pitrou commented Jul 31, 2013

    Work in progress in bpo-18214.

    @pitrou pitrou closed this as completed Jul 31, 2013
    @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

    3 participants