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

Frozen NamespaceLoader is leaking into the source _bootstrap_external in the tests #92265

Open
FFY00 opened this issue May 3, 2022 · 2 comments
Labels
topic-importlib type-bug An unexpected behavior, bug, or error

Comments

@FFY00
Copy link
Member

FFY00 commented May 3, 2022

Bug report

While implementing #92205 I ran into the issue of the source version of test_importlib.test_api.ReloadTests holding on to the frozen version of _bootstrap_external.

Your environment

  • CPython versions tested on: main
  • Operating system and architecture:
@FFY00 FFY00 added the type-bug An unexpected behavior, bug, or error label May 3, 2022
@FFY00 FFY00 changed the title Frozen _bootstrap_external is leaking into the source _bootstrap in the tests May 3, 2022
@FFY00 FFY00 changed the title Frozen NamespaceLoader is leaking into the source _bootstrap in the tests May 3, 2022
@FFY00

This comment was marked as outdated.

@FFY00
Copy link
Member Author

FFY00 commented May 3, 2022

The issue seems to be that the tests don't replace the path hooks, and because of that import_module gives us a NamespaceLoader from the frozen module.

FFY00 added a commit to FFY00/cpython that referenced this issue May 3, 2022
…_namespace_changed

Previously, we were blocking the frozen imports and forceing the source
version to be used, but we did not fix up sys.meta_path or
sys.path_hooks, causing the frozen importers to leak into the source
version of the test.
miss-islington pushed a commit that referenced this issue May 16, 2022
…pace_changed (GH-92275)

Previously, we were blocking the frozen imports and forcing the source
version to be used, but we did not fix up sys.meta_path or
sys.path_hooks, causing the frozen importers to leak into the source
version of the test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-importlib type-bug An unexpected behavior, bug, or error
1 participant