> > Why should I have to use a trailing backslash to get a directory > > listing? That's not in the FTP standard and probably won't work > > everywhere. > > It's the way the code is written for the FTP wrapper in urllib; has > nothing to do with ftp.python.org or FTP. Basically the code checks to > see if there is a trailing slash. If it does it assumes it is a > directory and thus only requests a listing of the path from the server. Ah, right. Sorry. Alzheimer is setting in early today. :-) > Otherwise it tries to get the file. If that get fails (with a 550) it > then decides to try getting a listing for the path. If that works it > returns that, otherwise it completely fails. > > Basically I don't think there is a way to make this work for urllib > nicely. Depends on what you call nicely. I think of the current behavior as "nice", because directories are a lot more common that files you can't read in the typical ftp setup. > If no one has any objections I will just clarify the docs > stating that if an attempt to get a file fails on a 550 error (and of > course I will say what that means) it will then try a LIST command and > if that succeeds that is what is returned. And if you need more > fine-grained control then use ftplib. Sounds good to me. Thanks! --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4