]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #8867: Fix `Tools/scripts/serve.py` to work with files containing
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 3 Aug 2010 17:09:36 +0000 (17:09 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 3 Aug 2010 17:09:36 +0000 (17:09 +0000)
non-ASCII content.

Misc/NEWS
Tools/scripts/serve.py

index 91cdb60872c0cf9d9b32349b8c15b0f178782efe..a1f07f7a46ca385cfdb889828891e00956b2d02f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -85,6 +85,12 @@ Library
 
 - Add lfu_cache() and lru_cache() decorators to the functools module.
 
+Tools/Demos
+-----------
+
+- Issue #8867: Fix ``Tools/scripts/serve.py`` to work with files containing
+  non-ASCII content.
+
 
 What's New in Python 3.2 Alpha 1?
 =================================
index c3b7bdbaaf710983185489ce18a1d87e2897c37c..89b3d6218fb8821b918c77cb4aa62c3d0ee98e78 100755 (executable)
@@ -19,7 +19,7 @@ def app(environ, respond):
 
     if os.path.exists(fn):
         respond('200 OK', [('Content-Type', type)])
-        return util.FileWrapper(open(fn))
+        return util.FileWrapper(open(fn, "rb"))
     else:
         respond('404 Not Found', [('Content-Type', 'text/plain')])
         return ['not found']