[issue27816] sock.proto does not reflect actual protocol

2021-10-21 Thread Christian Heimes
Christian Heimes added the comment: I can still reproduce the issue with Python 3.9 and newer. >>> import socket >>> socket.socket(socket.AF_INET, socket.SOCK_STREAM).proto 0 -- type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6 __

[issue27816] sock.proto does not reflect actual protocol

2016-08-20 Thread Martin Panter
Martin Panter added the comment: The documentation already says “Socket objects also have these (read-only) attributes that correspond to the values given to the socket constructor. . . . socket.proto”. For existing versions of Python, I’m not sure there is much else we can do. In Issue 27377

[issue27816] sock.proto does not reflect actual protocol

2016-08-20 Thread Christian Heimes
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 >>>