classification
Title: Python 3.5+ socket.socketpair fallback incorrectly implemented
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: SethMichaelLarson, benjamin.peterson
Priority: normal Keywords:

Created on 2016-12-28 07:23 by SethMichaelLarson, last changed 2016-12-29 04:23 by SethMichaelLarson. 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
2016-12-29 04:23:32SethMichaelLarsonsetmessages: + msg284227
2016-12-29 04:21:15benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg284226

resolution: not a bug
2016-12-28 07:23:21SethMichaelLarsoncreate