Skip to content

inspect.getmodule fails when module imports change sys.modules #57696

@ErikTollerud

Description

@ErikTollerud
BPO 13487
Nosy @gpshead, @amauryfa, @ned-deily, @merwok, @meadori, @ericsnowcurrently, @serhiy-storchaka, @tomdz, @miss-islington
PRs
  • bpo-13487: Use sys.modules.copy() in inspect for thread safety #18786
  • [3.8] bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. (GH-18786) #18787
  • [3.7] bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. (GH-18786) #18788
  • Files
  • getmodulefix.patch
  • 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/gpshead'
    closed_at = <Date 2020-03-05.01:07:10.959>
    created_at = <Date 2011-11-27.03:06:48.658>
    labels = ['3.7', '3.8', 'type-bug', 'library']
    title = 'inspect.getmodule fails when module imports change sys.modules'
    updated_at = <Date 2020-03-10.07:48:53.641>
    user = 'https://bugs.python.org/ErikTollerud'

    bugs.python.org fields:

    activity = <Date 2020-03-10.07:48:53.641>
    actor = 'ned.deily'
    assignee = 'gregory.p.smith'
    closed = True
    closed_date = <Date 2020-03-05.01:07:10.959>
    closer = 'gregory.p.smith'
    components = ['Library (Lib)']
    creation = <Date 2011-11-27.03:06:48.658>
    creator = 'Erik.Tollerud'
    dependencies = []
    files = ['23790']
    hgrepos = []
    issue_num = 13487
    keywords = ['patch']
    message_count = 20.0
    messages = ['148438', '148459', '148487', '148509', '148511', '148581', '148583', '299829', '301376', '302312', '302327', '302337', '363402', '363403', '363407', '363408', '363409', '363410', '363411', '363810']
    nosy_count = 12.0
    nosy_names = ['gregory.p.smith', 'amaury.forgeotdarc', 'ned.deily', 'eric.araujo', 'meador.inge', 'python-dev', 'eric.snow', 'Erik.Tollerud', 'serhiy.storchaka', 'psimons', 'tomdzk', 'miss-islington']
    pr_nums = ['18786', '18787', '18788']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'commit review'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue13487'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    Metadata

    Metadata

    Assignees

    Labels

    3.7 (EOL)end of life3.8 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions