This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: timeout option of socket.create_connection is not respected
Type: behavior Stage:
Components: IO Versions: Python 3.9
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Nicolas SURRIBAS
Priority: normal Keywords:

Created on 2022-02-03 14:18 by Nicolas SURRIBAS, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg412443 - (view) Author: Nicolas SURRIBAS (Nicolas SURRIBAS) Date: 2022-02-03 14:18
When passing to socket.create_connection a timeout option above (approximately) 127 seconds, the timeout is not respected. 

Code to reproduce the issue :

import socket
from time import monotonic

start = monotonic()
    socket.create_connection(("", 21), 300)
except Exception as exception:

print(monotonic() - start)

Output at execution:

[Errno 110] Connection timed out

Expected behavior would be that the "Connection timed out" exception is raised after 300 seconds, as given in argument, not 129.

Observed with Python 3.9.1
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90783
2022-02-03 14:18:19Nicolas SURRIBAScreate