Closed asmeurer closed 10 years ago
Ah, so the FTP adapter uses the raw commands, not the ones exposed by FTP clients. The equivalent is actually RETR. You can make the adapter support GET by adding 'GET' to the func_table
.
It should do the same as what RETR
does.
So 'GET': self.retr
wants to have some username and password.
If I add self.conn.login()
before code = self.conn.retrbinary('RETR ' + path, data_callback_factory(data))
it works. Is this a good idea?
If you pass an Auth tuple to conn.get it'll work, I think. Just pass a tuple of empty strings.
I really have no idea about any of this. I'll just submit a PR and you can tell me if I am doing something stupid.
=) Sure.
I am trying to use this at https://github.com/conda/conda/pull/682 to get FTP support for downloading. I am getting
(that corresponds to https://github.com/Lukasa/requests-ftp/blob/master/requests_ftp/ftp.py#L157).
Anyway way to support
GET
? Do I just need to mount this differently? I am currently doingself.mount("ftp://", FTPAdapter())
in mySession
subclass.