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

AttributeError: module 'socket' has no attribute 'SO_REUSEPORT'. Did you mean: 'SO_REUSEADDR'? #26

Open
Coloradohusky opened this issue Aug 8, 2022 · 2 comments
Labels
need further information Replied with further information needed

Comments

@Coloradohusky
Copy link

Trying out your example given in the documentation gives me this error:

C:\Users\Coloradohusky\Downloads\IPTV>iptv-filter -i https://gist.githubusercontent.com/sdhzdmzzl/93cf74947770066743fff7c7f4fc5820/raw/11107d2dcfe2f5785e7ada94bb44c0cd349191c5/bj-unicom-iptv.m3u -t http://epg.51zmt.top:8000/test.m3u
  0%|                                                                                          | 0/165 [00:01<?, ?it/s]
Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Coloradohusky\AppData\Roaming\Python\Python310\Scripts\iptv-filter.exe\__main__.py", line 7, in <module>
  File "C:\Users\Coloradohusky\AppData\Roaming\Python\Python310\site-packages\iptvtools\iptv_filter.py", line 74, in main
    playlist.filter()
  File "C:\Users\Coloradohusky\AppData\Roaming\Python\Python310\site-packages\iptvtools\models.py", line 160, in filter
    elif not utils.check_connectivity(url, self.args.timeout):
  File "C:\Users\Coloradohusky\AppData\Roaming\Python\Python310\site-packages\iptvtools\utils.py", line 98, in check_connectivity
    return check_udp_connectivity(parsed_url.netloc, timeout)
  File "C:\Users\Coloradohusky\AppData\Roaming\Python\Python310\site-packages\iptvtools\utils.py", line 108, in check_udp_connectivity
    sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
AttributeError: module 'socket' has no attribute 'SO_REUSEPORT'. Did you mean: 'SO_REUSEADDR'?

Windows 10, Python 3.10.6.

@Coloradohusky
Copy link
Author

Maybe this has something to do with it?

Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants exposed on the API which are not implemented on GNU/Hurd. They would not work at runtime anyway.

@huxuan
Copy link
Owner

huxuan commented Sep 4, 2022

Hi @Coloradohusky,

Seems I can not reproduce the same error (with python 3.10.6 on Mac).

Would you prefer run the command python -c "import socket; print(socket.__file__); print(dir(socket))" to check the socket module is properly imported and double check the existence of SO_REUSERPORT attribute?

@huxuan huxuan added the need further information Replied with further information needed label Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need further information Replied with further information needed
Projects
None yet
Development

No branches or pull requests

2 participants