Skip to content

Commit 4a679cc

Browse files
committed
fix unicode error in printing access log (Bug#277334)
1 parent eb7aa01 commit 4a679cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web/httpserver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys, os
44
import webapi as web
55
import net
6+
import utils
67

78
def runbasic(func, server_address=("0.0.0.0", 8080)):
89
"""
@@ -212,7 +213,7 @@ def log(self, status, environ):
212213
time = self.log_date_time_string()
213214

214215
msg = self.format % (host, time, protocol, method, req, status)
215-
print >> outfile, msg.encode('utf-8')
216+
print >> outfile, utils.safestr(msg)
216217

217218
func = WSGIWrapper(func)
218219
server = CherryPyWSGIServer(server_address, func, server_name="localhost")

0 commit comments

Comments
 (0)