Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f767f08

Browse files
committed
Issue #8867: Fix Tools/scripts/serve.py to work with files containing
non-ASCII content.
1 parent 6b54e1f commit f767f08

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ Library
8585

8686
- Add lfu_cache() and lru_cache() decorators to the functools module.
8787

88+
Tools/Demos
89+
-----------
90+
91+
- Issue #8867: Fix ``Tools/scripts/serve.py`` to work with files containing
92+
non-ASCII content.
93+
8894

8995
What's New in Python 3.2 Alpha 1?
9096
=================================

Tools/scripts/serve.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def app(environ, respond):
1919

2020
if os.path.exists(fn):
2121
respond('200 OK', [('Content-Type', type)])
22-
return util.FileWrapper(open(fn))
22+
return util.FileWrapper(open(fn, "rb"))
2323
else:
2424
respond('404 Not Found', [('Content-Type', 'text/plain')])
2525
return ['not found']

0 commit comments

Comments
 (0)