msg292580 - (view) |
Author: Giampaolo Rodola' (giampaolo.rodola) *  |
Date: 2017-04-29 08:55 |
>>> import socket >>> s = socket.socket(socket.AF_UNIX) >>> s.getsockname() b'' >>> s.bind('foo') >>> s.getsockname() 'foo' |
|
|
msg292581 - (view) |
Author: Giampaolo Rodola' (giampaolo.rodola) *  |
Date: 2017-04-29 09:03 |
The change was introduced here: https://github.com/python/cpython/commit/b10c71daa2099c450101e5854fd693a405bec49c |
|
|
msg292702 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2017-05-01 21:37 |
Amusingly, binding to the empty string produces something different: >>> s = socket.socket(socket.AF_UNIX) >>> s.getsockname() b'' >>> s.bind(b'') >>> s.getsockname() b'\x000005d' while binding to the nul byte string produces the expected result: >>> s = socket.socket(socket.AF_UNIX) >>> s.bind(b'\x00') >>> s.getsockname() b'\x00' |
|
|
msg292776 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2017-05-02 15:20 |
New changeset 495b5021e73e3c4b6404417ecf4fa83aa10297f0 by Antoine Pitrou in branch 'master': bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux (#1370) https://github.com/python/cpython/commit/495b5021e73e3c4b6404417ecf4fa83aa10297f0 |
|
|
msg292781 - (view) |
Author: Giampaolo Rodola' (giampaolo.rodola) *  |
Date: 2017-05-02 15:38 |
Thanks. |
|
|
msg292806 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2017-05-02 21:19 |
Test fails on x86 Tiger 3.x: http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/600/steps/test/logs/stdio ====================================================================== FAIL: testUnbound (test.test_socket.TestUnixDomain) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_socket.py", line 4687, in testUnbound self.assertEqual(self.sock.getsockname(), '') AssertionError: None != '' |
|
|
msg292807 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2017-05-02 21:20 |
Maybe restrict the unit test to Linux since the change was specific to Linux? |
|
|
msg292809 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2017-05-02 21:27 |
Oh, yuck. > Maybe restrict the unit test to Linux since the change was specific to Linux? That sounds reasonable. I didn't know getsockname() could return None... |
|
|
msg292810 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2017-05-02 21:32 |
> I didn't know getsockname() could return None... Me neither. Maybe it's a bug? makesockaddr() returns None if addrlen equals 0: if (addrlen == 0) { /* No address -- may be recvfrom() from known socket */ Py_RETURN_NONE; } |
|
|
msg292818 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2017-05-02 22:14 |
New changeset 0c2ff0898db2db9cd9c643dfadbff11761bacf5f by Antoine Pitrou in branch '3.6': Backport bpo-30205 to 3.6 (#1403) https://github.com/python/cpython/commit/0c2ff0898db2db9cd9c643dfadbff11761bacf5f |
|
|
msg292819 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2017-05-02 22:22 |
New changeset 0d9d61828bbd6cbc289489bf1d439fa91eca3743 by Antoine Pitrou in branch '3.5': Backport bpo-30205 to 3.5 (#1404) https://github.com/python/cpython/commit/0d9d61828bbd6cbc289489bf1d439fa91eca3743 |
|
|