-
Notifications
You must be signed in to change notification settings - Fork 274
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
Implement create_module() and exec_module() for _SixMetaPathImporter #341
Comments
For context: https://bugs.python.org/issue26131 & python/cpython#23469 |
Extra context: pypa/setuptools#2481. |
Reproducer: $ python3.10 -W error -c 'import six.moves.urllib_parse'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 1026, in _find_and_load
File "<frozen importlib._bootstrap>", line 1005, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 681, in _load_unlocked
ImportWarning: _SixMetaPathImporter.exec_module() not found; falling back to load_module() |
pytest workaround 👇Here's an example of how to suppress the warning until fixed: cherrypy/cheroot@5fbcb25 |
Honestly, this is causing us a lot of problems because we are already testing all Python packages in Fedora with the latest Python 3.10. It would be great if somebody who understands the magic of these methods proposes a fix. The warning can be suppressed by we are not able to do it in hundreds of packages and we'd very like to fix the core problem. If nobody with a better understanding do it, I'll take a look next week. |
I've tried the look into this yesterday but there's no clear examples of implementing the required methods (there's +1 extra method necessary). @frenzymadness if you have a centralized place in the infra, you could try to use a |
To reproduce the issue:
|
I wrote PR #343 to fix this issue. |
Fixes #341. Co-authored-by: Benjamin Peterson <[email protected]>
Seems to be raised when importing six (via tldextract/requests/urllib) on Python 3.10: benjaminp/six#341 See #6068
It currently breaks all builds and even after pytest-dev#8540 it looks like tests still fail because of benjaminp/six#341 As a hotfix, mark it as experimental until everything is fixed, so that our CI isn't all red.
Use of
load_module()
whenexec_module()
is not defined will raise anImportWarning
in Python 3.10.The text was updated successfully, but these errors were encountered: