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 liZe
Recipients liZe
Date 2018-09-16.08:18:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1537085899.9.0.956365154283.issue34702@psf.upfronthosting.co.za>
In-reply-to
Content
urlopen includes query strings in the filename with "file"-scheme URLs.

>>> from urllib.request import urlopen
>>> urlopen('file:///tmp/test')
<addinfourl at 140059890562888 whose fp = <_io.BufferedReader name='/tmp/test'>>
>>> urlopen('file:///tmp/test?q')
Traceback (most recent call last):
  File "/usr/lib/python3.7/urllib/request.py", line 1473, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/test?q'

This behavior seems to be OK with what RFC 8089 tells, but many other implementations (including browsers and curl) remove query strings from the filename.
History
Date User Action Args
2018-09-16 08:18:19liZesetrecipients: + liZe
2018-09-16 08:18:19liZesetmessageid: <1537085899.9.0.956365154283.issue34702@psf.upfronthosting.co.za>
2018-09-16 08:18:19liZelinkissue34702 messages
2018-09-16 08:18:19liZecreate