GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-65961: Stop setting or using `__package__` on modules by brettcannon · Pull Request #142046 · python/cpython

Conversation

@brettcannon

@brettcannon brettcannon commented Nov 28, 2025 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: update the import machinery to only use __spec__ #65961

📚 Documentation preview 📚: https://cpython-previews--142046.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
brettcannon added 4 commits November 26, 2025 14:59
@brettcannon
Initial attempt
ff5fc7d
```
21 tests altered the execution environment (env changed):
    test_logging test_pathlib test_profile test_pty test_pulldom
    test_pwd test_pyclbr test_pyexpat test_pyrepl test_pystats
    test_resource test_rlcompleter test_robotparser test_sax
    test_sched test_secrets test_select test_set test_shlex test_str
    test_thread

5 tests failed:
    test_capi test_cmd_line_script test_importlib test_repl
    test_sysconfig
```
@brettcannon
Fix test_importlib
d625711
@brettcannon
Merge branch 'main' of github.com:python/cpython into remove-__package__
7bfde50
@brettcannon
Fix test_cmd_line_script
ff7547f
@bedevere-app bedevere-app Bot mentioned this pull request Nov 28, 2025
update the import machinery to only use __spec__ #65961
Open
@brettcannon

brettcannon commented Nov 28, 2025

Copy link
Copy Markdown
Member Author

Currently a draft until the test_capi failure can somehow be resolved as I have no idea how what I'm doing is the direct cause of the failure.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

brettcannon added 4 commits November 28, 2025 11:37
@brettcannon
Merge branch 'main' into remove-__package__
7f373ed
@brettcannon
Add a news entry
2fe0f74
@brettcannon
Merge branch 'remove-__package__' of github.com:brettcannon/cpython i…
b2cbe7f
…nto remove-__package__
@brettcannon
Make Ruff happy
cb85b87
@brettcannon brettcannon mentioned this pull request Nov 28, 2025
GH-65961: Stop setting __package__ on modules #142055
Closed
@brettcannon

brettcannon commented Nov 28, 2025

Copy link
Copy Markdown
Member Author

#142055 is an alternative to this PR where __package__ is no longer set, but is still supported.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon

brettcannon commented Nov 28, 2025

Copy link
Copy Markdown
Member Author

Yet again this project gets postponed, this time thanks to pip: https://github.com/pypa/pip/blob/36987b0c31b97ffb9fb7949ded628e9a6b10c016/src/pip/__main__.py#L13

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon

brettcannon commented Nov 28, 2025

Copy link
Copy Markdown
Member Author

The test_capi test failure is still weird, regardless, but this PR is now dead in the water.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon brettcannon closed this Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pablogsal pablogsal Awaiting requested review from pablogsal pablogsal will be requested when the pull request is marked ready for review pablogsal is a code owner
@lysnikolaou lysnikolaou Awaiting requested review from lysnikolaou lysnikolaou will be requested when the pull request is marked ready for review lysnikolaou is a code owner
@ambv ambv Awaiting requested review from ambv ambv will be requested when the pull request is marked ready for review ambv is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner will be requested when the pull request is marked ready for review AA-Turner is a code owner
@gaogaotiantian gaogaotiantian Awaiting requested review from gaogaotiantian gaogaotiantian will be requested when the pull request is marked ready for review gaogaotiantian is a code owner
@terryjreedy terryjreedy Awaiting requested review from terryjreedy terryjreedy will be requested when the pull request is marked ready for review terryjreedy is a code owner
@1st1 1st1 Awaiting requested review from 1st1 1st1 will be requested when the pull request is marked ready for review 1st1 is a code owner
@asvetlov asvetlov Awaiting requested review from asvetlov asvetlov will be requested when the pull request is marked ready for review asvetlov is a code owner
@kumaraditya303 kumaraditya303 Awaiting requested review from kumaraditya303 kumaraditya303 will be requested when the pull request is marked ready for review kumaraditya303 is a code owner
@willingc willingc Awaiting requested review from willingc willingc will be requested when the pull request is marked ready for review willingc is a code owner
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently will be requested when the pull request is marked ready for review ericsnowcurrently is a code owner
@FFY00 FFY00 Awaiting requested review from FFY00 FFY00 will be requested when the pull request is marked ready for review FFY00 is a code owner
@ncoghlan ncoghlan Awaiting requested review from ncoghlan ncoghlan will be requested when the pull request is marked ready for review ncoghlan is a code owner
@warsaw warsaw Awaiting requested review from warsaw warsaw will be requested when the pull request is marked ready for review warsaw is a code owner
@ZeroIntensity ZeroIntensity Awaiting requested review from ZeroIntensity ZeroIntensity will be requested when the pull request is marked ready for review ZeroIntensity is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@brettcannon
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.