Problems with FTP

RizlaJ razajaffrey77 at gmail.com
Fri Jan 21 15:01:48 EST 2011


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.



More information about the Python-list mailing list