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 <rep...@bugs.python.org>
<http://bugs.python.org/issue27816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to