Skip to content

GH-65961: Stop setting or using __package__ on modules - #142046

Closed
brettcannon wants to merge 8 commits into
python:mainfrom
brettcannon:remove-__package__
Closed

GH-65961: Stop setting or using __package__ on modules#142046
brettcannon wants to merge 8 commits into
python:mainfrom
brettcannon:remove-__package__

Conversation

@brettcannon

@brettcannonbrettcannon commented Nov 28, 2025

Copy link
Copy Markdown
Member

```
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

Copy link
Copy Markdown
MemberAuthor

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.

@brettcannon

Copy link
Copy Markdown
MemberAuthor

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

@brettcannon

Copy link
Copy Markdown
MemberAuthor

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

@brettcannon

Copy link
Copy Markdown
MemberAuthor

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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@brettcannon