New submission from Nicolas SURRIBAS <nicolas.surri...@gmail.com>:

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

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

print(monotonic() - start)

Output at execution:

None
[Errno 110] Connection timed out
129.3075186319984

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

----------
components: IO
messages: 412443
nosy: Nicolas SURRIBAS
priority: normal
severity: normal
status: open
title: timeout option of socket.create_connection is not respected
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46625>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to