python / cpython

The Python programming language
https://www.python.org
Other
63.67k stars 30.5k forks source link

ftplib.py transfer timeouts breaking controlchannel connection #123535

Open sven-borkert opened 2 months ago

sven-borkert commented 2 months ago

Bug report

Bug description:

Hi,

I'm currently writing a Python tool that is supposed to perform tests against an ftp server. I noticed that a timeout on a transfer causes the whole FTP object become unusable/timeouted. This is unexpected, because a timeout on a transfer (data channel) does not mean that the ftp control channel is broken. Control channel and data channel are different connections, and you should be still able to use the control channel when one of many transfers breaks with a timeout. My current solution is to re-open the control channel whenever a transfer breaks with a timeout, but I cannot even log out on the control channel anymore in this situation.

Regards, Sven

CPython versions tested on:

3.12

Operating systems tested on:

Linux

rruuaanng commented 2 months ago

Can you provide the code with the error?