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

distlib 0.3.9 breaks virtualenv in zipapp on Windows #235

Closed
gaborbernat opened this issue Oct 17, 2024 · 3 comments · Fixed by pypa/virtualenv#2783
Closed

distlib 0.3.9 breaks virtualenv in zipapp on Windows #235

gaborbernat opened this issue Oct 17, 2024 · 3 comments · Fixed by pypa/virtualenv#2783

Comments

@gaborbernat
Copy link

gaborbernat commented Oct 17, 2024

The error is 'DistlibFinder' object has no attribute 'iterator'. See https://github.com/pypa/virtualenv/actions/runs/11375057581/job/31644998367?pr=2782

  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "C:\Users\runneradmin\AppData\Local\Temp\pytest-of-unknown\pytest-0\zipapp0\virtualenv.pyz\virtualenv\seed\embed\via_app_data\via_app_data.py", line 17, in <module>
  File "C:\Users\runneradmin\AppData\Local\Temp\pytest-of-unknown\pytest-0\zipapp0\virtualenv.pyz\virtualenv\seed\embed\via_app_data\pip_install\copy.py", line 8, in <module>
    x = copy.deepcopy(y)            # make a deep copy of y
  File "C:\Users\runneradmin\AppData\Local\Temp\pytest-of-unknown\pytest-0\zipapp0\virtualenv.pyz\virtualenv\seed\embed\via_app_data\pip_install\base.py", line 13, in <module>
  File "C:\Users\runneradmin\AppData\Local\Temp\pytest-of-unknown\pytest-0\zipapp0\virtualenv.pyz\__virtualenv__/distlib-0.3.9-py2.py3-none-any/distlib/scripts.py", line 66, in <module>
AttributeError: 'DistlibFinder' object has no attribute 'iterator'
@gaborbernat gaborbernat changed the title distlib 0.3.9 breaks virtualenv on Windows distlib 0.3.9 breaks virtualenv in zipapp on Windows Oct 17, 2024
@gaborbernat
Copy link
Author

gaborbernat commented Oct 17, 2024

https://distlib.readthedocs.io/en/latest/reference.html#distlib.resources.register_finder says that the finder must implement PEP-302... which only defines for finder:

image

So where does this iterator come from? Impacted code:

https://github.com/pypa/virtualenv/blob/main/tasks/__main__zipapp.py#L72-L87

@gaborbernat
Copy link
Author

cc @pfmoore

@vsajip
Copy link
Collaborator

vsajip commented Oct 18, 2024

I'm confused - what change in 0.3.9 caused this? Or did it not, seeing as you've closed the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants