-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
imports of distutils pick up wrong parent module #12490
Comments
Closes #259 Ref pytest-dev/pytest#12490
I tested to see if the proposed fix for 12044 has any effect, but it does not, so it's unlikely related. |
Disabling
And further disabling
That gives some clue about what might be going on. |
I put a breakpoint on |
Here's what the call stack looks like when
It seems that |
I've confirmed that |
Alright. I think I've distilled the issue. Starting from this near-minimal repro:
It's important that Then run pytest 8.2.2 on Python 3.11 thus:
Important - Don't run with Also relevant, don't have Setuptools installed as it has a distutils hack that may interfere. Output from that command looks something like:
Tracing the behavior, I've found that the wrong distutils gets imported as part of Line 855 in 57bc6df
Although that call results in an |
Of course, setting On the other hand, this issue narrowly affects distutils because of its special relationship with the legacy in stdlib. I'm slightly tempted to suggest we just sweep this issue under the rug - acknowledge it exists and otherwise have distutils patch out the undesirable behavior or just disable the namespace packages consideration. |
Closes #259 Ref pytest-dev/pytest#12490
In pypa/distutils#259, I'm tracking down an emergent regression in the import logic that breaks the test suite on pytest 8.1 and 8.2.
It looks like it's successfully discovering
distutils/cygwincompiler.py
, but then when a relative import from there imports.version
, it's getting$prefix/lib/distutils/version.py
.I haven't yet root caused it, and it may be related to
#12044 orother open issues.I'll continue to investigate until I have a better reproducer.
The text was updated successfully, but these errors were encountered: