Message265078
On android getservbyname(const char *NAME, const char *PROTO) returns NULL when PROTO is NULL:
root@generic_x86:/data/local/tmp # python
Python 3.6.0a0 (default:811ccdee6f87+, May 7 2016, 17:56:37)
[GCC 4.9 20140827 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.getservbyname('daytime', 'tcp')
13
>>> socket.getservbyname('daytime', 'udp')
13
>>> socket.getservbyname('daytime')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: service/proto not found
>>>
On android socket.getaddrinfo() raises an exception when port is not a number:
>>> socket.getaddrinfo('127.0.0.1', 80)
[(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('127.0.0.1', 80)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('127.0.0.1', 80))]
>>> socket.getaddrinfo('127.0.0.1', 'http')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/sdcard/org.bitbucket.pyona/lib/python3.6/socket.py", line 732, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 9] servname not supported for ai_socktype
>>> |
|
Date |
User |
Action |
Args |
2016-05-07 16:47:13 | xdegaye | set | recipients:
+ xdegaye, Alex.Willmer |
2016-05-07 16:47:13 | xdegaye | set | messageid: <1462639633.35.0.426596704206.issue26936@psf.upfronthosting.co.za> |
2016-05-07 16:47:13 | xdegaye | link | issue26936 messages |
2016-05-07 16:47:12 | xdegaye | create | |
|