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

vendored six module raises ImportWarning with Python 3.10 and 3.11a3 #3502

Closed
grayjk opened this issue Jan 7, 2022 · 5 comments · Fixed by #3552
Closed

vendored six module raises ImportWarning with Python 3.10 and 3.11a3 #3502

grayjk opened this issue Jan 7, 2022 · 5 comments · Fixed by #3552

Comments

@grayjk
Copy link

grayjk commented Jan 7, 2022

Brief description

In Python 3.10 and 3.11a3, importing from scapy raises an ImportWarning:

$ python3.11 -W default
Python 3.11.0a3 (main, Jan  6 2022, 09:16:02) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from scapy import base_classes
<frozen importlib._bootstrap>:1049: ImportWarning: _SixMetaPathImporter.find_spec() not found; falling back to find_module()
<frozen importlib._bootstrap>:673: ImportWarning: _SixMetaPathImporter.exec_module() not found; falling back to load_module()

The version of six (scapy/modules/six.py) in scapy is 1.10.0 which is missing implementations of find_spec and exec_module.

The fall back methods were deprecated beginning in Python 3.10: https://docs.python.org/3.10/whatsnew/3.10.html#deprecated

six version 1.16.0 includes the missing methods.

Scapy version

2.4.5

Python version

3.11a3

Operating system

Ubuntu 18.04

Additional environment information

No response

How to reproduce

$ python3.11 -W default
Python 3.11.0a3 (main, Jan  6 2022, 09:16:02) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from scapy import base_classes
<frozen importlib._bootstrap>:1049: ImportWarning: _SixMetaPathImporter.find_spec() not found; falling back to find_module()
<frozen importlib._bootstrap>:673: ImportWarning: _SixMetaPathImporter.exec_module() not found; falling back to load_module()

Actual result

No response

Expected result

No response

Related resources

No response

@6r1d
Copy link

6r1d commented Feb 22, 2022

Can confirm on Artix with Scapy 2.4.5rc1.dev199, Python 3.10.2, IPython 8.0.1.
I see a series of:

<frozen importlib._bootstrap>:914: ImportWarning: _SixMetaPathImporter.find_spec() not found; falling back to find_module()
<frozen importlib._bootstrap>:671: ImportWarning: _SixMetaPathImporter.exec_module() not found; falling back to load_module()
<frozen importlib._bootstrap>:671: ImportWarning: _SixMetaPathImporter.exec_module() not found; falling back to load_module()```

@David-OConnor
Copy link

Same; python 3.10.1.

@yuanxpy
Copy link

yuanxpy commented Mar 1, 2023

but i use python 3.10.1;six 1.16.0,also have the warnings……

@p-l-
Copy link
Member

p-l- commented Apr 14, 2023

For the record, Scapy no longer ships (or use) the six module. @wuzue this is Scapy repository, I don't think you project uses it.

@PabloCastellano
Copy link

I found this nice blog post explaining the root of this mysterious issue https://blog.pecar.me/six-warnings

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

Successfully merging a pull request may close this issue.

7 participants