From f767f08e290d0caa42148083940a08e8425b18f2 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 3 Aug 2010 17:09:36 +0000 Subject: Issue #8867: Fix `Tools/scripts/serve.py` to work with files containing non-ASCII content. --- Misc/NEWS | 6 ++++++ Tools/scripts/serve.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS b/Misc/NEWS index 91cdb60..a1f07f7 100644 --- 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? ================================= diff --git a/Tools/scripts/serve.py b/Tools/scripts/serve.py index c3b7bdb..89b3d62 100755 --- a/Tools/scripts/serve.py +++ b/Tools/scripts/serve.py @@ -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'] -- cgit v0.12