Skip to content

Implement FrozenImporter.get_source() #89821

Open

Description

@ericsnowcurrently
BPO 45658
Nosy @ericsnowcurrently, @FFY00

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 = None
created_at = <Date 2021-10-28.18:36:49.102>
labels = ['type-bug', 'library', '3.11']
title = 'Implement FrozenImporter.get_source()'
updated_at = <Date 2021-10-28.18:37:14.221>
user = 'https://github.com/ericsnowcurrently'

bugs.python.org fields:

activity = <Date 2021-10-28.18:37:14.221>
actor = 'eric.snow'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-10-28.18:36:49.102>
creator = 'eric.snow'
dependencies = []
files = []
hgrepos = []
issue_num = 45658
keywords = []
message_count = 2.0
messages = ['405219', '405220']
nosy_count = 2.0
nosy_names = ['eric.snow', 'FFY00']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue45658'
versions = ['Python 3.11']

Activity

  1. ericsnowcurrently commented on Oct 28, 2021

    @ericsnowcurrently
    MemberAuthor

    FrozenImporter (in Lib/importlib/_bootstrap.py) has a get_source() method but it always returns None. Now that __file__ is set on frozen (stdlib) modules, we can implement FrozenImporter.get_source() appropriately.

  2. added
    3.11only security fixes
    stdlibStandard Library Python modules in the Lib/ directory
    type-bugAn unexpected behavior, bug, or error
    on Oct 28, 2021
  3. ericsnowcurrently commented on Oct 28, 2021

    @ericsnowcurrently
    MemberAuthor

    Note that once the get_source() implementation is done, the only missing method for importlib.abc.InspectLoader is source_to_code(). (See https://docs.python.org/3/library/importlib.html#importlib.abc.InspectLoader.)

  4. transferred this issue fromon Apr 10, 2022
  5. added
    type-featureA feature request or enhancement
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixesstdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions