This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ftplib.py: IndexError in voidresp occasionally
Type: behavior Stage: test needed
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, giampaolo.rodola, kxroberto
Priority: normal Keywords: patch

Created on 2007-05-26 18:39 by kxroberto, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg52671 - (view) Author: kxroberto (kxroberto) Date: 2007-05-26 18:39
A 1-char manual patch (still applies from 2.3 up to latest python trunk):


C:\Python23\Lib>diff -u org ftplib.py
--- org/ftplib.py       2002-06-03 11:41:46.000000000 +0200
+++ ftplib.py   2007-05-26 20:33:58.086219200 +0200
@@ -219,7 +219,7 @@
     def voidresp(self):
         """Expect a response beginning with '2'."""
         resp = self.getresp()
-        if resp[0] != '2':
+        if resp[:1] != '2':
             raise error_reply, resp
         return resp




--
it solves a rare:
  ...
  File "ftplib.pyo", line 386, in retrbinary 
  File "ftplib.pyo", line 222, in voidresp
IndexError: string index out of range




Robert
msg85477 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-04-05 10:48
Fixed in r71217. Thanks!
History
Date User Action Args
2022-04-11 14:56:24adminsetgithub: 44999
2009-04-05 10:48:56georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg85477

resolution: fixed
2009-03-30 23:38:29ajaksu2setnosy: + giampaolo.rodola

type: behavior
stage: test needed
2007-05-26 18:39:50kxrobertocreate