Skip to content

None _frozen_importlib.__spec__.origin attribute #79502

Closed

Description

@maggyero
mannequin
BPO 35321
Nosy @warsaw, @brettcannon, @ncoghlan, @ericsnowcurrently, @nnja, @JulienPalard, @maggyero
PRs
  • bpo-35321: Set the spec origin to frozen in frozen modules #11732
  • 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/nnja'
    closed_at = <Date 2019-02-14.21:07:38.508>
    created_at = <Date 2018-11-26.23:19:31.209>
    labels = ['interpreter-core', '3.8', 'type-bug', '3.7']
    title = 'None _frozen_importlib.__spec__.origin attribute'
    updated_at = <Date 2019-02-14.21:07:38.507>
    user = 'https://github.com/maggyero'

    bugs.python.org fields:

    activity = <Date 2019-02-14.21:07:38.507>
    actor = 'maggyero'
    assignee = 'nnja'
    closed = True
    closed_date = <Date 2019-02-14.21:07:38.508>
    closer = 'maggyero'
    components = ['Interpreter Core']
    creation = <Date 2018-11-26.23:19:31.209>
    creator = 'maggyero'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35321
    keywords = ['patch']
    message_count = 8.0
    messages = ['330479', '330558', '334005', '334006', '334007', '334852', '335561', '335564']
    nosy_count = 7.0
    nosy_names = ['barry', 'brett.cannon', 'ncoghlan', 'eric.snow', 'nnja', 'mdk', 'maggyero']
    pr_nums = ['11732']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue35321'
    versions = ['Python 3.7', 'Python 3.8']

    Activity

    1. maggyero commented on Nov 26, 2018

      maggyeromannequin
      MannequinAuthor

      How to reproduce:
      In Python:

      import _frozen_importlib
      print(frozen_importlib.__spec_.origin)

      Observed result:
      The __spec__.origin attribute of the _frozen_importlib module is None.

      Expected result:
      The __spec__.origin attribute of the _frozen_importlib module should be 'frozen', like it is already the case for the _frozen_importlib_external module and documented for all frozen modules in PEP-451: https://www.python.org/dev/peps/pep-0451/#origin

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Nov 26, 2018
    3. brettcannon commented on Nov 27, 2018

      @brettcannon
      Member

      I can replicate.

      Do note, though, that PEPs are not documentation once they are implemented; at that point the official docs are what should be followed.

    4. added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      type-bugAn unexpected behavior, bug, or error
      and removed
      stdlibStandard Library Python modules in the Lib/ directory
      on Nov 27, 2018
    5. warsaw commented on Jan 18, 2019

      @warsaw
      Member

      Frozen module's origin isn't really documented AFAICT. Here's the link to the library reference:

      https://docs.python.org/3/library/importlib.html?highlight=origin#importlib.machinery.ModuleSpec.origin

      The language reference doesn't really have anything to say here. I think it wouldn't be difficult to add 'frozen' to the origin, but it should also be documented in the library reference (and of course, tested).

    6. self-assigned this
      on Jan 18, 2019
    7. nnja commented on Jan 18, 2019

      @nnja
      Contributor

      I'll be happy to take a look at this.

    8. warsaw commented on Jan 18, 2019

      @warsaw
      Member

      I am mentoring Nina so I'll review this.

    9. warsaw commented on Feb 5, 2019

      @warsaw
      Member

      New changeset 69091cb by Barry Warsaw (Nina Zakharenko) in branch 'master':
      bpo-35321: Set the spec origin to frozen in frozen modules (bpo-11732)
      69091cb

    10. brettcannon commented on Feb 14, 2019

      @brettcannon
      Member

      Can this be closed?

    11. maggyero commented on Feb 14, 2019

      maggyeromannequin
      MannequinAuthor

      Yes, closed.

    12. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.7 (EOL)end of life3.8 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions