socket.getaddrinfo appears to be completely broken, all name resolutions fail
See original GitHub issueVersions
- Python:
python3crystax
(app), python 3 on host for building - OS: Ubuntu in docker for building, android 7 for test
- Kivy: not used
- Cython: most likely not relevant (can check if it is)
Description
Name resolution with socket.getaddrinfo
just seems to plain not work, here is what I get for google.com
(while nslookup google.com
in termux or just browsing google.com in the web browser works fine):
11-07 03:17:28.760 30786 30818 I python : Traceback (most recent call last):
11-07 03:17:28.760 30786 30818 I python : File "/mnt/expand/50b713c2-bef0-4226-aea1-000678d55d07/user/0/com.example.app/files/app/crystax_python/site-packages/nettools/__init__.py", line 59, in dns_lookup_multitarget
11-07 03:17:28.761 30786 30818 I python : name, None, socket.AF_INET6)
11-07 03:17:28.761 30786 30818 I python : File "/mnt/expand/50b713c2-bef0-4226-aea1-000678d55d07/user/0/com.example.app/files/app/crystax_python/stdlib.zip/socket.py", line 743, in getaddrinfo
11-07 03:17:28.761 30786 30818 I python : for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
11-07 03:17:28.761 30786 30818 I python : socket.gaierror: [Errno 7] No address associated with hostname
11-07 03:17:28.761 30786 30818 I python :
11-07 03:17:28.761 30786 30818 I python : During handling of the above exception, another exception occurred:
11-07 03:17:28.761 30786 30818 I python :
11-07 03:17:28.761 30786 30818 I python : Traceback (most recent call last):
11-07 03:17:28.761 30786 30818 I python : File "<console>", line 1, in <module>
11-07 03:17:28.761 30786 30818 I python : File "/mnt/expand/50b713c2-bef0-4226-aea1-000678d55d07/user/0/com.example.app/files/app/crystax_python/site-packages/nettools/__init__.py", line 78, in dns_lookup
11-07 03:17:28.761 30786 30818 I python : raise last_error
11-07 03:17:28.762 30786 30818 I python : File "/mnt/expand/50b713c2-bef0-4226-aea1-000678d55d07/user/0/com.example.app/files/app/crystax_python/site-packages/nettools/__init__.py", line 66, in dns_lookup_multitarget
11-07 03:17:28.762 30786 30818 I python : name, None, socket.AF_INET)
11-07 03:17:28.762 30786 30818 I python : File "/mnt/expand/50b713c2-bef0-4226-aea1-000678d55d07/user/0/com.example.app/files/app/crystax_python/stdlib.zip/socket.py", line 743, in getaddrinfo
11-07 03:17:28.762 30786 30818 I python : for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
11-07 03:17:28.762 30786 30818 I python : socket.gaierror: [Errno 7] No address associated with hostname
The same code works fine on desktop (with python 3 on GNU/Linux and Microsoft Windows). Please note I wrote nettools
so I’m not using some odd third-party wrapper that may do whatever instead of just looking up the hostname - all the function I wrote does is automatically try AF_INET6
first and fall back to AF_INET
if that doesn’t work (as should be easy to reconstruct from the backtrace).
I tested this on latest master with the ctypes fix pull request on top ( #1433 ) which shouldn’t affect name resolution.
buildozer.spec
not used, I build with a p4a one liner
Logs
see backtrace above
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top GitHub Comments
😆 yup, was internet permission
how to give android internet permissions(I gave it, but it does not show up)