FTP filename escaping
bugs at almad.net
Thu May 11 15:24:19 EDT 2006
I feel ashamed, but my google-fu betrayed me again.
How do I escape filenames when using ftplib? I'd like to download it
and upload on ftp again...
toDown = self.ftpMaster.nlst()
for fileDown in toDown:
f = tmpfile()
self.ftpMaster.retrbinary(''.join(['RETR ', fileDown]),
self.ftpMirror.storbinary(''.join(["STOR ", fileDown]), f,
Problem is when fileDown contains special characters / spaces and so
on. I hoped for some ftplib.quote(), urllib.quote() or quote_plus() is
not functional either.
Is there such a function in stdlib or do I have to read through
specification and write it?
More information about the Python-list