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.

Author sjones
Recipients
Date 2003-06-15.00:45:14
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=589306

The problem seems to happen when you use a callback within a
function that was called as a callback. Here is a much
simpler case that demonstrates the problem:

-----------------------------
import ftplib
 
def transferFile(listLine):
    filename = listLine.split()[-1]
    if filename == 'README':
        # Note that retrlines uses a default
        # callback that just prints the file
        f.retrlines('RETR README') # <-- Fails
 
f=ftplib.FTP('ftp.python.org', 'ftp', 'anon@')
f.cwd('/pub/python')
f.retrlines('LIST', transferFile)
f.close()
-----------------------------

This fails with the following:

Traceback (most recent call last):
  File "ftptest.py", line 10, in ?
    f.retrlines('LIST', transferFile)
  File "/home/sjones/src/python/dist/src/Lib/ftplib.py",
line 407, in retrlines
    callback(line)
  File "ftptest.py", line 6, in transferFile
    f.retrlines('RETR README') # <-- Fails
  File "/home/sjones/src/python/dist/src/Lib/ftplib.py",
line 396, in retrlines
    conn = self.transfercmd(cmd)
  File "/home/sjones/src/python/dist/src/Lib/ftplib.py",
line 345, in transfercmd
    return self.ntransfercmd(cmd, rest)[0]
  File "/home/sjones/src/python/dist/src/Lib/ftplib.py",
line 321, in ntransfercmd
    host, port = self.makepasv()
  File "/home/sjones/src/python/dist/src/Lib/ftplib.py",
line 299, in makepasv
    host, port = parse227(self.sendcmd('PASV'))
  File "/home/sjones/src/python/dist/src/Lib/ftplib.py",
line 566, in parse227
    raise error_reply, resp
ftplib.error_reply: 200 Type set to A.


Note this is with the current CVS version on Redhat 9.
History
Date User Action Args
2007-08-23 14:13:48adminlinkissue751758 messages
2007-08-23 14:13:48admincreate