[issue17967] urllib2.open failed to access a url when a perent directory of the url is permission denied
zhaoqifa added the comment: Sorry for replying so late. 1) Will the above change have any security implications. ---It does not seem to me either. 2) On Ubuntu, I am unable to setup a directory based (ACL'ed) anonymous ftp server. The option is either anonymous from ftp root (/) which will map to my operating system folder (/srv/ftp) or non-anonymous. I wonder how your server is configured to allow anonymous from a particular point onwards. ---I configured proftpd like this: Limit WRITE DIRS DenyAll /Limit Directory /home/* Limit DIRS LIST NLIST AllowAll /Limit /Directory And get message as bellow when login anonymous: lftp perf00:~ cd /home cd: Access failed: 550 /home: No such file or directory lftp perf00:~ cd /home/work cd ok, cwd=/home/work lftp perf00:/home/work cd /home/work/test cd ok, cwd=/home/work/test lftp perf00:/home/work/test ls drwxrwxr-x 8 work work 4096 Jun 15 2011 pb -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17967 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17967] urllib2.open failed to access a url when a perent directory of the url is permission denied
zhaoqifa added the comment: I had run test by python ./urllib.py -t, test steps for accessing /etc/passwd, file:/etc/passwd, file://localhost/etc/passwd passed, steps for ftp://ftp.gnu.org/pub/README not tested because my work env is not free for internet accessing. And, I have not tried version 3.3. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17967 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17967] urllib2.open failed to access a url when a perent directory of the url is permission denied
New submission from zhaoqifa: 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. -- messages: 189097 nosy: foxkiller priority: normal severity: normal status: open title: urllib2.open failed to access a url when a perent directory of the url is permission denied type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17967 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17967] urllib2.open failed to access a url when a perent directory of the url is permission denied
Changes by zhaoqifa qifa.z...@gmail.com: -- components: +Library (Lib) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17967 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com