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: SimpleHTTPServer docs out of date
Type: Stage:
Components: Documentation Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, ggenellina
Priority: normal Keywords:

Created on 2003-12-27 06:18 by ggenellina, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg19485 - (view) Author: Gabriel Genellina (ggenellina) Date: 2003-12-27 06:18
The Library documentation about SimpleHTTPServer.
py is out of date:



In extensions_map:
Default is signified by an empty string, and is 
considered to be text/plain.[...]

should read

Default is signified by an empty string, and is 
considered to be application/octet-stream.



In do_GET:
If the request was mapped to a directory, a 403 
respond is output, followed by the explanation 
'Directory listing not supported'. Any IOError [...]

should read:

If the request was mapped to a directory, a file 
named index.html or index.htm (in that order) is 
searched inside it. If found, then its contents are 
returned; otherwise a directory listing is generated 
using os.listdir. (In case the os.listdir call fails, a 404 
error response is sent).
Any IOError [...]


Later in do_GET:
The file is always opened in binary mode.

should read:

If the file MIME type starts with 'text/' the file is 
opened in text mode; in any other case binary mode 
is used.



The docstrings inside the module are outdated too.
Line 28 (class SimpleHTTPRequestHandler) says:

It assumes that all files are plain text files unless 
they have the extension ".html" in which case it 
assumes they are HTML files.

That's not true; that paragraph should be deleted, 
or make a reference to method guess_type() below.



Docstring for method guess_type() says:

[...] using text/plain as a default [...]

should read:

[...] using application/octet-stream as a default [...]


msg19486 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2004-08-07 19:12
Logged In: YES 
user_id=11375

Fixed on both the CVS HEAD and the 2.3 branch.  Thanks for reporting 
this!
History
Date User Action Args
2022-04-11 14:56:01adminsetgithub: 39734
2003-12-27 06:18:09ggenellinacreate