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: MIME header for local files
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: doerwalter, gvanrossum, jhylton
Priority: normal Keywords:

Created on 2001-05-02 14:46 by doerwalter, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Messages (4)
msg4625 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2001-05-02 14:46
For local files urllib.py doesn't return the MIME 
headers that the documentation says it does:

http://www.python.org/doc/current/lib/module-
urllib.html#l2h-2187 states that "When the method is 
local-file, returned headers will include a Date 
representing the file's last-modified time, a Content-
Length giving file size, and a Content-Type containing 
a guess at the file's type"

But in Python 2.1 the only header that gets returned
is the Content-Type:

>>> import urllib
>>> f = urllib.urlopen("gurk.txt")      
>>> f.info().headers  
['Content-Type: text/plain\n']
msg4626 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2001-05-02 16:22
Logged In: YES 
user_id=89016

A patch (#420753) has been upload to SF.
msg4627 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2001-05-09 15:57
Logged In: YES 
user_id=31392

What do you think, Paul?
msg4628 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2001-08-09 17:43
Logged In: YES 
user_id=6380

Good patch.  APplied as urllib.py 1.128 (with cosmetic
changes to avoid long lines).

(What was the point of assigning this to PaulP?)
History
Date User Action Args
2022-04-10 16:04:01adminsetgithub: 34449
2001-05-02 14:46:38doerwaltercreate