Hi,
I am trying to use ftplib.FTP_TLS to connect to a MS FTP server but whenever I try to do a storbinary it hangs the connection and only finishes it by issuing an exception.
*get* '220 Microsoft FTP Service\n'
*resp* '220 Microsoft FTP Service'
.....
*cmd* 'STOR x.txt'
*put* 'STOR x.txt\r\n'
*get* '125 Data connection already open; Transfer starting.\n'
*resp* '125 Data connection already open; Transfer starting.'
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\ftplib.py", line 539, in storlines
conn.unwrap()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\ssl.py", line 1318, in unwrap
s = self._sslobj.shutdown()
ConnectionResetError: [WinError 10054] An existing connection was forced to be dropped by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\ftplib.py", line 539, in storlines
conn.unwrap()
I've seen some "solutions" on stackoverflow saying to only comment or pass the part with error on the storbinary method, such as:
if isinstance(conn, ssl.SSLSocket):
# HACK: Instead of attempting unwrap the connection, pass here
pass
but this does seem like a hack and not a good solution. It would be nice to have a more definite trustworthy solution in the ftplib library.
Cheers,
Linked PRs
Hi,
I am trying to use ftplib.FTP_TLS to connect to a MS FTP server but whenever I try to do a storbinary it hangs the connection and only finishes it by issuing an exception.
I've seen some "solutions" on stackoverflow saying to only comment or pass the part with error on the storbinary method, such as:
but this does seem like a hack and not a good solution. It would be nice to have a more definite trustworthy solution in the ftplib library.
Cheers,
Linked PRs