Issue 29091: Python 3.5+ socket.socketpair fallback incorrectly implemented (original) (raw)

Issue29091

Created on 2016-12-28 07:23 by SethMichaelLarson, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg284158 - (view) Author: Seth Michael Larson (SethMichaelLarson) * Date: 2016-12-28 07:23
The socket.socketpair() fallback for Python 3.5+ is incorrectly implemented from the original source. The fallback doesn't provide a backlog argument to the lsock.listen() function call. When running the function it gives the following error: `TypeError: listen() takes exactly one argument (0 given)` Issue can be seen here on line 514: https://hg.python.org/cpython/file/3.6/Lib/socket.py Should add 1 as the argument to listen() to bring the implementation in line with the source implementation at: https://gist.github.com/geertj/4325783
msg284226 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2016-12-29 04:21
Are you using that implementation on Python 2? Python 3's socket.listen has one optional backlog argument.
msg284227 - (view) Author: Seth Michael Larson (SethMichaelLarson) * Date: 2016-12-29 04:23
Sorry for making noise, yes I was using the implementation in Python 2.x. I will do better investigation in the future.
History
Date User Action Args
2022-04-11 14:58:41 admin set github: 73277
2016-12-29 04:23:32 SethMichaelLarson set messages: +
2016-12-29 04:21:15 benjamin.peterson set status: open -> closednosy: + benjamin.petersonmessages: + resolution: not a bug
2016-12-28 07:23:21 SethMichaelLarson create