urllib.urlretrieve and PASV mode

Andrew Markebo andrew.markebo at telia.com
Sat Mar 22 06:20:36 EST 2003


/ "Thomas Weholt" <2002 at weholt.org> wrote:
| As far as I know, passive mode is ftp-specific. Urllib is used to fetch
| files served over http and passive mode is not relevant to that protocol.
| Correct me if I'm wrong.

URL's can both specify FTP and HTTP targets, so you are
wrong.. correcting correcting... :-)

|> Is there a way when using urllib.urlretrieve() to
|> use passive mode for ftp transfers?  It looks like
|> this is supported in ftplib (set_pasv method),
|> but not used by urllib. Unless I'm missing something.

Throwing an eye or two at the source, nope doesn't seem so, and how to
fix it.. Either use ftplib directly yourself, or copy urllib and
modify it so it sets PASV. (Hmm having a global variable FTPPASV or
similar, and depending on what that is, let ftpwrapperclass call
set_pasv..)

       /Andy

-- 
 The eye of the beholder rests on the beauty!




More information about the Python-list mailing list