Problems with FTP

Giampaolo Rodolà g.rodola at gmail.com
Fri Jan 21 15:24:41 EST 2011


The standard FTP protocol does not supporty any kind of proxy-ing
feature natively.
The only closest thing to the concept of a "proxy" we can find in the
FTP protocol is the site-to-site transfer feature:
http://code.google.com/p/pyftpdlib/wiki/FAQ#What_is_FXP?
...but it's something different.

By taking a look at your code, though, this is out of question anyway
since you can't even connect to the server, let alone send proxy-like
(non-standard) commands.
I'd focus on investigating whether it's something with the internal
network and forget about proxy-related problems since from here I can
connect to indexftp.barcap.com.
As for urllib's proxy option I'd say it's only valid for HTTP protocol.

--- Giampaolo
http://code.google.com/p/pyftpdlib/
http://code.google.com/p/psutil/


2011/1/21 RizlaJ <razajaffrey77 at gmail.com>:
> Hi Tom, Giampaolo,
>
> Thank you both for your swift replies. I have asked our IT dept to see
> if it is the firewall that is blocking the FTP. They are working on
> that side of things.
>
> However I would have thought that the following or some version of it
> would have worked:-
>
>>>> import urllib
>>>> proxies = ({'ftp':proxyserveraddress'})
>>>> some_url = ({'ftp':'indexftp.barcap.com'})
>>>> filehandle = urllib.urlopen(some_url, proxies=proxies)
>
> Traceback (most recent call last):
>  File "<pyshell#51>", line 1, in <module>
>    filehandle = urllib.urlopen(some_url, proxies=proxies)
>  File "C:\Python27\lib\urllib.py", line 84, in urlopen
>    return opener.open(url)
>  File "C:\Python27\lib\urllib.py", line 177, in open
>    fullurl = unwrap(toBytes(fullurl))
>  File "C:\Python27\lib\urllib.py", line 1026, in unwrap
>    url = url.strip()
> AttributeError: 'dict' object has no attribute 'strip'
>
> However as you can see there is an error - is this again related to
> the firewall do you think?
>
> Sorry for asking stupid questions! and thank you for your help in
> advance.
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list