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

repr(six.moves) throws an AttributeError for cpython 3.12 #376

Open
15r10nk opened this issue Sep 21, 2023 · 5 comments
Open

repr(six.moves) throws an AttributeError for cpython 3.12 #376

15r10nk opened this issue Sep 21, 2023 · 5 comments

Comments

@15r10nk
Copy link

15r10nk commented Sep 21, 2023

import six.moves

repr(six.moves)

output (Python 3.12.0rc3+):

Traceback (most recent call last):
  File "/home/frank/projects/executing/bug.py", line 3, in <module>
    repr(six.moves)
  File "<frozen importlib._bootstrap>", line 545, in _module_repr
  File "<frozen importlib._bootstrap>", line 830, in _module_repr_from_spec
AttributeError: '_SixMetaPathImporter' object has no attribute '_path'
@lauromoura
Copy link

Looks like the cause is CPython's python/cpython@bd221c0, which expects the spec to have the _path parameter, although this attribute is not mentioned explicitly in the PEP302 (Import hooks PEP).

Not sure if the right fix would be there or adding a _path attribute to six's meta importer.

@15r10nk
Copy link
Author

15r10nk commented Oct 20, 2023

looks to me like this should be fixed in cpython. It should also be a problem for any importer, or is there a reason why they should have a _path attribute?

@benjaminp
Copy link
Owner

Did anyone file a CPython bug?

@15r10nk
Copy link
Author

15r10nk commented Oct 23, 2023

I did not. but I am having trouble making a repro without six. I would be nice if someone else could submit a bug report.

@hmstepanek
Copy link

I was running into this issue on 3.12.0 but it looks like this has been fixed on 3.12.1: python/cpython#112414.

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

No branches or pull requests

4 participants