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 christian.heimes
Recipients christian.heimes, martin.panter, r.david.murray
Date 2017-01-21.23:43:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1485042188.11.0.718308820236.issue28134@psf.upfronthosting.co.za>
In-reply-to
Content
Here is another example of how broken and dangerous fileno argument is. getpeername() is neither a valid IPv4 tuple nor a valid IPv6 tuple. It's all messed up:

>>> import socket
>>> s = socket.create_connection(('www.python.org', 443))
>>> s
<socket.socket fd=3, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('2003:58:bc4a:3b00:56ee:75ff:fe47:ca7b', 59730, 0, 0), raddr=('2a04:4e42:1b::223', 443, 0, 0)>
>>> socket.socket(fileno=s.fileno())
<socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('2003:58:bc4a:3b00::%2550471192', 59730, 0, 2550471192), raddr=('2a04:4e42:1b:0:700c:e70b:ff7f:0%2550471192', 443, 0, 2550471192)>
History
Date User Action Args
2017-01-21 23:43:08christian.heimessetrecipients: + christian.heimes, r.david.murray, martin.panter
2017-01-21 23:43:08christian.heimessetmessageid: <1485042188.11.0.718308820236.issue28134@psf.upfronthosting.co.za>
2017-01-21 23:43:08christian.heimeslinkissue28134 messages
2017-01-21 23:43:07christian.heimescreate