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 irmen
Date 2003-11-10.20:42:43
SpamBayes Score
Marked as misclassified
(Python 2.3.2 on Windows)

SimpleHTTPServer reports the size of the file on disk
as Content-Length. This works except for text files.
If the content type starts with "text/" it is opening the
file in 'text' mode rather than 'binary' mode. At least on
Windows this causes newline translations, thereby making
the  actual size of the content transmitted *less* than
the content-length!

I don't know why SimpleHTTPServer is reading text files
with text mode. The included patch removes this distinction
so all files are opened in binary mode (and, also on
the actual size transmitted is the same as the reported

--Irmen de Jong
Date User Action Args
2007-08-23 15:29:44adminlinkissue839496 messages
2007-08-23 15:29:44admincreate