[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-05 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file12608/socket_real_close-2.patch ___ Python tracker ___ ___ Python-bugs-lis

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-05 Thread STINNER Victor
STINNER Victor added the comment: New patch: - Change _socket.fileno() behaviour: raise socket.error("I/O operation on closed socket") (instead of returning -1) if the socket is closed - Change SocketIO.fileno(): raise a socket.error("I/O operation on closed socket") if the file is closed,

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-05 Thread STINNER Victor
STINNER Victor added the comment: Issue #3826 is the same issue and has already patch with 2 unit tests. The patch is different: it uses "del self._sock". ___ Python tracker ___

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-05 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file12608/socket_real_close-2.patch ___ Python tracker ___ ___ Python-bugs-list

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-05 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file12606/socket_real_close.patch ___ Python tracker ___ ___ Python-bugs-list

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-05 Thread STINNER Victor
STINNER Victor added the comment: Patch: SocketIO.close() decrements the io reference of its socket, so socket.close() will really close the socket. About the FTP server ftp2.edgecastcdn.net, it looks like the server doesn't write "226 Transfert completed" until the data socket is really clo

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-05 Thread STINNER Victor
STINNER Victor added the comment: Ok, some news about this bug (I tested the ftp test account): the problem is that the data socket is not closed when self.voidresp() is called. I can't see close() syscall before the call to self.voidresp(). SocketIO.close() does nothing: it does not really

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-05 Thread Christopher Mahan
Christopher Mahan added the comment: Edgecast.com support created a test ftp account for the purpose of troubleshooting this issue. Please email me (chris.ma...@gmail.com) and I'll forward you the login info. ___ Python tracker

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-05 Thread Christopher Mahan
Christopher Mahan added the comment: Update: I requested a test ftp account from edgecast. The tech's response was that he would file a request for it. Will update. ___ Python tracker _

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread Christopher Mahan
Christopher Mahan added the comment: When running scritp with python 2.5.4, got this error. I'll remove the "timeout=2" and run again. see below. Traceback (most recent call last): File "C:\python_scripts\python3\candee_processor.py", line 3, in ftp = ftplib.FTP('ftp.edgecastcdn.net', us

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread STINNER Victor
STINNER Victor added the comment: Christopher: Can you paste the full output with debuglevel=3 of Python 2.x (python2.5)? ___ Python tracker ___ _

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread STINNER Victor
STINNER Victor added the comment: The traceback shows that the problem is not related to the socket created to retrieve the content of the directory listing, but the "main" socket (the one used for the whole ftp session) used by dir() command the retrieve the command answer code: Tracebac

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread Christopher Mahan
Christopher Mahan added the comment: Per Giampaolo's suggestion, I added the timeout. Program listing and output below: -begin listing import ftplib ftp = ftplib.FTP('ftp.edgecastcdn.net', user='theusername', passwd='thepassword', timeout=2) ftp.set_debuglevel(3) ftp.cwd('chrismahan-67

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I'm unable to reproduce the issue. Could you please repeat the test by using the "timeout" parameter as such? < ftp = ftplib.FTP('ftp.edgecastcdn.net', user='theusername', passwd='thepassword') > ftp = ftplib.FTP('ftp.edgecastcdn.net', user='theusername',

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread Christopher Mahan
Christopher Mahan added the comment: haypo writes: >By default, the socket created to get the result of LIST has no >timeout (is blocking). So fp.readline() only returns an empty string >when the socket is closed (by the server). Even if the server closed the socket and fp.readline() returned

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread Christopher Mahan
Christopher Mahan added the comment: Full output with debuglevel 3 *cmd* 'CWD chrismahan-675' *put* 'CWD chrismahan-675\r\n' *get* '250 CWD command successful\n' *resp* '250 CWD command successful' *cmd* 'TYPE A' *put* 'TYPE A\r\n' *get* '200 Type set to A\n' *resp* '200 Type set to A' *cmd* 'P

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread STINNER Victor
STINNER Victor added the comment: Can you paste the full output with debuglevel=3? "if not line:" should be equivalent to "if len(line) == 0:" and to "if line == '':". ftp.dir() is equivalent to ftp.retrlines('LIST'). By default, the socket created to get the result of LIST has no timeout (

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-01 Thread Christopher Mahan
Christopher Mahan added the comment: I added the following two lines and I was able to run the code. Before: line = fp.readline() if self.debugging > 2: print('*retr*', repr(line)) if not line: break if line[-2:] == CRLF:

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-01 Thread Christopher Mahan
Christopher Mahan added the comment: I went into the source for Libs/ftplib.py and I noted that line 423 is: if self.debugging > 2: print('*retr*', repr(line)) so I changed the debuglevel to 3, as such: ftp.set_debuglevel(3) and I got these last 4 lines: -rwxrwxrwx 1 nobody nogroup

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-01 Thread Christopher Mahan
Christopher Mahan added the comment: I modified the program by adding line: ftp.set_debuglevel(2) START LISTING import ftplib ftp = ftplib.FTP('ftp.edgecastcdn.net', user='myuserid', passwd='mypassword') ftp.set_debuglevel(2) ftp.cwd('chrismahan-675') ftp.dir() #ftp.retrlines('L

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-01 Thread STINNER Victor
STINNER Victor added the comment: > Can you put some print diagnostics inside Lib/ftplib.py (...) .set_debuglevel(2) already prints a lot of informations. ___ Python tracker ___ ___

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-01 Thread Daniel Diniz
Daniel Diniz added the comment: Hi Chris Since dir calls retrlines and retrlines has a 'while 1:' loop, the bug probably comes from there. Either it hangs in the fp.readline call or the break condition is never met. Can you put some print diagnostics inside Lib/ftplib.py->FTP.retrlines (around

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-01 Thread STINNER Victor
STINNER Victor added the comment: I'm unable to reproduce the issue. I tried to create files on my FTP server with non-ASCII characters or spaces in the filenames, but everything is fine. Can you reproduce the problem outside IDLE? Or is the issue specific to IDLE? I mean: write a script and

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2008-12-31 Thread Christopher Mahan
Christopher Mahan added the comment: The list does not seem to contain non-ascii characters. ___ Python tracker ___ ___ Python-bugs-list mailin

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2008-12-31 Thread Christopher Mahan
Christopher Mahan added the comment: Added file screenshot of filezilla view of the folder in question. ___ Python tracker ___ ___ Python-bugs-

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2008-12-31 Thread Christopher Mahan
Christopher Mahan added the comment: the output: just before the non-responsiveness: -rwxrwxrwx 1 nobody nogroup 3905538 Dec 29 09:51 Bronski Beat - Why.mp3 -rwxrwxrwx 1 nobody nogroup873966 Dec 28 13:53 test9.avi -rwxrwxrwx 1 nobody nogroup 2512653 Dec 29 08:28 test9_lg.wmv

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2008-12-31 Thread STINNER Victor
STINNER Victor added the comment: Can you paste the expected result of ftp.retrlines('LIST')? Does a directory contains a non-ASCII character? -- nosy: +haypo ___ Python tracker ___

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2008-12-31 Thread Christopher Mahan
Christopher Mahan added the comment: Update: Ran the same code with python 2.6.1 on the same computer, and that worked fine. ___ Python tracker ___ ___

[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2008-12-31 Thread Christopher Mahan
Changes by Christopher Mahan : -- title: retrlines('LIST') and dir hang at end of listing in ftplib -> retrlines('LIST') and dir hang at end of listing in ftplib (python3.0) ___ Python tracker _