cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-121111: Fix `zipimport` incorrectly dealing with namespace packages

Open ZeroIntensity opened this issue 1 year ago • 6 comments

  • Issue: gh-121111

ZeroIntensity avatar Jun 29 '24 16:06 ZeroIntensity

This fix worked, Thank you so much.

AraHaan avatar Jul 01 '24 02:07 AraHaan

This fix worked, Thank you so much.

@AraHaan It just work, did not be fixed. Run the test to confirm.

SeaHOH avatar Jul 01 '24 04:07 SeaHOH

This fix worked, Thank you so much.

@AraHaan It just work, did not be fixed. Run the test to confirm.

It seems to work when backported to 3.12 for me.

AraHaan avatar Jul 01 '24 06:07 AraHaan

@serhiy-storchaka Could you take look at the testcase and patch?

SeaHOH avatar Jul 01 '24 07:07 SeaHOH

Can confirm that the test written by @SeaHOH continues to fail on the new patch. There were two bugs at play here, I only patched one of them (my original test case fails on the main branch, as of now).

The underlying problem is not directly with _is_dir, but it's that _read_directory doesn't have a way to represent empty directories. AFAIK, find_spec is only affected by this now.

ZeroIntensity avatar Jul 01 '24 14:07 ZeroIntensity

Sorry for my English is so bad. Seems #121233 fixed the bug.

SeaHOH avatar Jul 01 '24 17:07 SeaHOH