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.

classification
Title: urllib.request.urlopen throws on some valid FTP files
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Ian Liu Rodrigues
Priority: normal Keywords: patch

Created on 2018-11-13 19:20 by Ian Liu Rodrigues, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 10520 open python-dev, 2018-11-13 19:24
Messages (1)
msg329862 - (view) Author: Ian Liu Rodrigues (Ian Liu Rodrigues) * Date: 2018-11-13 19:20
Some FTP clients will not allow changing to a directory if the path does not ends with a slash. For example, try out this in a public FTP:

from ftplib import FTP
ftp = FTP('ftp.unicamp.br')
ftp.login()
ftp.cwd('pub/libreoffice') # throws error
ftp.cwd('pub/libreoffice/') # OK

The problem is urllib.request doesn't include the trailing slash, thus throwing an error. This behavior also happens with the command line ftp client.

I think this happens because the libreoffice directory is a symlink, and this can be a FTP server specific behavior.
History
Date User Action Args
2022-04-11 14:59:08adminsetgithub: 79417
2018-11-13 19:24:56python-devsetkeywords: + patch
stage: patch review
pull_requests: + pull_request9779
2018-11-13 19:20:41Ian Liu Rodriguescreate