This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xdegaye
Recipients Alex.Willmer, xdegaye
Date 2016-05-07.16:47:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1462639633.35.0.426596704206.issue26936@psf.upfronthosting.co.za>
In-reply-to
Content
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
>>>
History
Date User Action Args
2016-05-07 16:47:13xdegayesetrecipients: + xdegaye, Alex.Willmer
2016-05-07 16:47:13xdegayesetmessageid: <1462639633.35.0.426596704206.issue26936@psf.upfronthosting.co.za>
2016-05-07 16:47:13xdegayelinkissue26936 messages
2016-05-07 16:47:12xdegayecreate