[Python-checkins] cpython (merge 2.5 -> 2.6): merge from 2.5 branch.

senthil.kumaran python-checkins at python.org
Thu Mar 17 07:49:54 CET 2011


http://hg.python.org/cpython/rev/8cdb95cf096e
changeset:   68641:8cdb95cf096e
branch:      2.6
parent:      68377:d6626c9fc28d
parent:      68640:e9724d7abbc2
user:        Senthil Kumaran <orsenthil at gmail.com>
date:        Thu Mar 17 14:23:24 2011 +0800
summary:
  merge from 2.5 branch.

files:
  Lib/SimpleHTTPServer.py

diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py
--- a/Lib/SimpleHTTPServer.py
+++ b/Lib/SimpleHTTPServer.py
@@ -15,6 +15,7 @@
 import BaseHTTPServer
 import urllib
 import cgi
+import sys
 import shutil
 import mimetypes
 try:
@@ -131,7 +132,8 @@
         length = f.tell()
         f.seek(0)
         self.send_response(200)
-        self.send_header("Content-type", "text/html")
+        encoding = sys.getfilesystemencoding()
+        self.send_header("Content-type", "text/html; charset=%s" % encoding)
         self.send_header("Content-Length", str(length))
         self.end_headers()
         return f

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list