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

None _frozen_importlib.__spec__.origin attribute #79502

Closed
maggyero mannequin opened this issue Nov 26, 2018 · 8 comments
Closed

None _frozen_importlib.__spec__.origin attribute #79502

maggyero mannequin opened this issue Nov 26, 2018 · 8 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@maggyero
Copy link
Mannequin

maggyero mannequin commented Nov 26, 2018

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']

    @maggyero
    Copy link
    Mannequin Author

    maggyero mannequin commented Nov 26, 2018

    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

    @maggyero maggyero mannequin added stdlib Python modules in the Lib dir 3.7 (EOL) end of life labels Nov 26, 2018
    @brettcannon
    Copy link
    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.

    @brettcannon brettcannon added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error and removed stdlib Python modules in the Lib dir labels Nov 27, 2018
    @warsaw
    Copy link
    Member

    warsaw commented Jan 18, 2019

    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).

    @warsaw warsaw added the 3.8 only security fixes label Jan 18, 2019
    @nnja nnja self-assigned this Jan 18, 2019
    @nnja
    Copy link
    Contributor

    nnja commented Jan 18, 2019

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

    @warsaw
    Copy link
    Member

    warsaw commented Jan 18, 2019

    I am mentoring Nina so I'll review this.

    @warsaw
    Copy link
    Member

    warsaw commented Feb 5, 2019

    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

    @brettcannon
    Copy link
    Member

    Can this be closed?

    @maggyero
    Copy link
    Mannequin Author

    maggyero mannequin commented Feb 14, 2019

    Yes, closed.

    @maggyero maggyero mannequin closed this as completed Feb 14, 2019
    @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
    3.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants