[issue37405] socket.getsockname() returns string instead of tuple

2021-03-23 Thread Brent Gardner


Brent Gardner  added the comment:

This test was overlooked, and line 2052 should now be removed per the 
discussion here:

https://github.com/python/cpython/pull/14392#issuecomment-506133908

In short, getsockname() used to return `(interface, socket.AF_CAN)`, in which 
the socket.AF_CAN element was superfluous (also undocumented), so it was 
removed in the fix, and the tuple format was reinstated.

--

___
Python tracker 
<https://bugs.python.org/issue37405>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37405] socket.getsockname() returns string instead of tuple

2021-03-23 Thread Brent Gardner


Change by Brent Gardner :


--
pull_requests: +23749
pull_request: https://github.com/python/cpython/pull/24991

___
Python tracker 
<https://bugs.python.org/issue37405>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37405] socket.getsockname() returns string instead of tuple

2019-06-25 Thread Brent Gardner


Change by Brent Gardner :


--
type:  -> behavior

___
Python tracker 
<https://bugs.python.org/issue37405>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37405] socket.getsockname() returns string instead of tuple

2019-06-25 Thread Brent Gardner


New submission from Brent Gardner :

In Python 3.5.3, a socket with type AF_CAN returns a tuple in the form 
`(interface, )` from getsockname().  In Python 3.7.3, getsockname() returns a 
string (the name of the interface).  The documentation states "a tuple is used 
for the AF_CAN address family".  The string will break code that worked in 
3.5.3 by raising errors such as "Value Error: too many values to unpack 
(expected 2)".

Example:

#3.5.3
import socket
s = socket.socket(socket.AF_CAN, socket.SOCK_RAW, socket.CAN_RAW)
s.bind(('vcan0',)) # requires tuple
s.getsockname() # returns tuple: ('vcan0', 29)

#3.7.3
import socket
s = socket.socket(socket.AF_CAN, socket.SOCK_RAW, socket.CAN_RAW)
s.bind(('vcan0',)) # requires tuple
s.getsockname() # returns string: 'vcan0'

--
assignee: docs@python
components: Documentation
messages: 346559
nosy: Brent Gardner, docs@python
priority: normal
severity: normal
status: open
title: socket.getsockname() returns string instead of tuple
versions: Python 3.7

___
Python tracker 
<https://bugs.python.org/issue37405>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37405] socket.getsockname() returns string instead of tuple

2019-06-25 Thread Brent Gardner


Brent Gardner  added the comment:

Changed caused by commit effc12f8e9e20d0951d2ba5883587666bd8218e3 to 
cpython/Modules/socketmodule.c on Sep 6, 2017.

--
components: +Extension Modules

___
Python tracker 
<https://bugs.python.org/issue37405>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37405] socket.getsockname() returns string instead of tuple

2019-06-25 Thread Brent Gardner


Brent Gardner  added the comment:

Correction, change caused by a30f6d45ac3e72761b96a8df0527182029eaee24 to 
cpython/Modules/socketmodule.c on Aug 28, 2017.

--

___
Python tracker 
<https://bugs.python.org/issue37405>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com