This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author foxkiller
Recipients foxkiller
Date 2013-05-13.05:50:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1368424209.99.0.52540499369.issue17967@psf.upfronthosting.co.za>
In-reply-to
Content
urllib2.open failed to access a url when a perent directory of the url is permission denied.

I had a file in a ftp, the address is like ftp://host/home/work/123.txt which can be access by wget.
When I urllib2.open to access the file, it always tell me that:
urllib2.URLError: <urlopen error ftp error: 550 home: No such file or directory>

I found that the path /home is denied for anonymouse access but the path /home/work is not. 
urllib2.open try to call ftp.cwd("home") and then ftp.cwd("work") which failed when ftp.cwd("home").

I tried to fix this by changing "for dir in self.dirs: self.ftp.cwd(dir)" to "self.ftp.cwd(os.path.join(*self.dirs)" in urllib.py. And it works fine for this situation.
History
Date User Action Args
2013-05-13 05:50:10foxkillersetrecipients: + foxkiller
2013-05-13 05:50:09foxkillersetmessageid: <1368424209.99.0.52540499369.issue17967@psf.upfronthosting.co.za>
2013-05-13 05:50:09foxkillerlinkissue17967 messages
2013-05-13 05:50:09foxkillercreate