why can i still able to reproduce the SimpleHTTPServer bug which issaid fixed 3 years ago?

L

Leo Jay

http://bugs.python.org/issue1097597

in my python 2.5.2, i still find these code in SimpleHTTPServer.py,
is that deliberate?
ctype = self.guess_type(path)
if ctype.startswith('text/'):
mode = 'r'
else:
mode = 'rb'
try:
f = open(path, mode)
except IOError:
self.send_error(404, "File not found")
return None
self.send_response(200)
self.send_header("Content-type", ctype)
fs = os.fstat(f.fileno())
self.send_header("Content-Length", str(fs[6])) # <--
obviously, this is not the same with len(f.read()) in windows.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top