Ivan Pozdeev added the comment: * The initial msg253326 has a code snippet using ftplib directly and showing the error. * The linked issue28931 has another snippet that uses ftplib through urllib and results in the same error.
There isn't a single mention of "thread" in either. Could you just run either of them and see for yourself? I can rub your nose in it, but I thought you're better than that :) Oh well... C:\Ivan>python Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import ftplib >>> ftp = ftplib.FTP() >>> ftp.connect('ftp.debian.org', timeout=10) '220 ftp.debian.org FTP server' >>> ftp.login('anonymous','u...@example.com') '230 Login successful.' >>> ftp.sendcmd('TYPE A') '200 Switching to ASCII mode.' >>> s = ftp.transfercmd('LIST') >>> fp = s.makefile('r') >>> fp.read() 'drwxr-xr-x 9 1176 1176 4096 Dec 14 15:08 debian\r\n' >>> fp.close() >>> s.close() >>> # Now the session is broken: ... >>> ftp.sendcmd('NOOP') '226 Directory send OK.' >>> ftp.dir() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Py\lib\ftplib.py", line 534, in dir self.retrlines(cmd, func) File "C:\Py\lib\ftplib.py", line 437, in retrlines conn = self.transfercmd(cmd) File "C:\Py\lib\ftplib.py", line 376, in transfercmd return self.ntransfercmd(cmd, rest)[0] File "C:\Py\lib\ftplib.py", line 334, in ntransfercmd host, port = self.makepasv() File "C:\Py\lib\ftplib.py", line 312, in makepasv host, port = parse227(self.sendcmd('PASV')) File "C:\Py\lib\ftplib.py", line 830, in parse227 raise error_reply, resp ftplib.error_reply: 200 Switching to ASCII mode. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25458> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com