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 2018-11-13 19:24 by python-dev.

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
2018-11-13 19:24:56python-devsetkeywords: + patch
stage: patch review
pull_requests: + pull_request9779
2018-11-13 19:20:41Ian Liu Rodriguescreate