Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(132424)

Unified Diff: Lib/http/server.py

Issue 10980: http.server Header Unicode Bug
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Lib/test/test_httpservers.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Lib/http/server.py
===================================================================
--- Lib/http/server.py (revision 88141)
+++ Lib/http/server.py (working copy)
@@ -448,7 +448,7 @@
message = ''
if self.request_version != 'HTTP/0.9':
self.wfile.write(("%s %d %s\r\n" %
- (self.protocol_version, code, message)).encode('ASCII', 'strict'))
+ (self.protocol_version, code, message)).encode('latin1', 'strict'))
def send_header(self, keyword, value):
"""Send a MIME header."""
@@ -456,7 +456,7 @@
if not hasattr(self, '_headers_buffer'):
self._headers_buffer = []
self._headers_buffer.append(
- ("%s: %s\r\n" % (keyword, value)).encode('ASCII', 'strict'))
+ ("%s: %s\r\n" % (keyword, value)).encode('latin1', 'strict'))
if keyword.lower() == 'connection':
if value.lower() == 'close':
« no previous file with comments | « no previous file | Lib/test/test_httpservers.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+