[New-bugs-announce] [issue27816] sock.proto does not reflect actual protocol

Christian Heimes report at bugs.python.org
Sat Aug 20 12:21:59 EDT 2016


New submission from Christian Heimes:

The proto property of a socket object does not reflect the actual protocol of the socket file descriptor:

>>> import socket
>>> SO_PROTOCOL = getattr(socket, 'SO_PROTOCOL', 38)
>>> tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> tcp.proto
0
>>> tcp.getsockopt(socket.SOL_SOCKET, SO_PROTOCOL)
6
>>> socket.getprotobyname('tcp')
6

----------
components: Extension Modules
messages: 273222
nosy: christian.heimes
priority: normal
severity: normal
stage: needs patch
status: open
title: sock.proto does not reflect actual protocol
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27816>
_______________________________________


More information about the New-bugs-announce mailing list