FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-35181: Correct an assumption about the namespace package loader attribute by geryogam · Pull Request #10376 · python/cpython · GitHub

Repository navigation

bpo-35181: Correct an assumption about the namespace package loader attribute - #10376

Merged
warsaw merged 1 commit into
python:masterfrom
geryogam:patch-3
May 1, 2019
Merged

warsaw merged 1 commit into
python:masterfrom
geryogam:patch-3

Conversation

geryogam commented Nov 7, 2018 •
edited
Loading

Copy link
Copy Markdown
Contributor

The namespace package importlib._bootstrap.ModuleSpec.loader attribute is no longer None after calling the importlib._bootstrap._init_module_attrs function. But a namespace package can be detected with its importlib._bootstrap.ModuleSpec.origin attribute which is always None.

See https://stackoverflow.com/questions/52869541/namespace-package-spec-loader-and-loader-attributes-not-set-to-none

https://bugs.python.org/issue35181

…ger None

Namespace packages _bootstrap.ModuleSpec.loader attributes are no longer `None` _after_ calling the importlib._bootstrap._init_module_attrs function.

See:
* https://stackoverflow.com/questions/52869541/namespace-package-spec-loader-and-loader-attributes-not-set-to-none
* https://bugs.python.org/issue35181
bedevere-bot added docs Documentation in the Doc dir awaiting review labels Nov 7, 2018
geryogam changed the title bpo-35181: Namespace packages _bootstrap.ModuleSpec.loader attributes are no longer None bpo-35181: Namespace packages _bootstrap.ModuleSpec.loader attributes no longer None Nov 7, 2018
geryogam changed the title bpo-35181: Namespace packages _bootstrap.ModuleSpec.loader attributes no longer None bpo-35181: Correct a false asumption about namespace packages _bootstrap.ModuleSpec.loader attributes Nov 7, 2018
geryogam changed the title bpo-35181: Correct a false asumption about namespace packages _bootstrap.ModuleSpec.loader attributes bpo-35181: Correct an assumption about namespace packages _bootstrap.ModuleSpec.loader attributes Nov 7, 2018
geryogam changed the title bpo-35181: Correct an assumption about namespace packages _bootstrap.ModuleSpec.loader attributes bpo-35181: Correct an assumption about namespace package _bootstrap.ModuleSpec.loader attribute Nov 7, 2018
geryogam changed the title bpo-35181: Correct an assumption about namespace package _bootstrap.ModuleSpec.loader attribute bpo-35181: Correct an assumption about namespace package loader attribute Nov 7, 2018
geryogam changed the title bpo-35181: Correct an assumption about namespace package loader attribute bpo-35181: Correct an assumption about the namespace package loader attribute Nov 7, 2018

warsaw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm going to approve this, since I think the logic is more right with your change. However, it makes me uncomfortable about the fragility of this code snippet, since it isn't tested. Clearly the buggy code wasn't found when the original change was made. Too bad we don't have doctests for the internal documentation.

Not your problem though, and thanks for your contribution!

warsaw commented May 1, 2019

Copy link
Copy Markdown
Member

I don't think we need a news item for this so I added the skip news label. Any objections?

Copy link
Copy Markdown
Member

I agree on the skip news label.

warsaw merged commit ee88af3 into python:master May 1, 2019

Copy link
Copy Markdown

@warsaw: Please replace # with GH- in the commit message next time. Thanks!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL