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

Leo Jay python.leojay at gmail.com
Fri Jun 13 09:02:48 CEST 2008


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'
            mode = 'rb'
            f = open(path, mode)
        except IOError:
            self.send_error(404, "File not found")
            return None
        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.

Best Regards,
Leo Jay

More information about the Python-list mailing list