Mercurial > p > roundup > code
diff roundup/cgi/wsgi_handler.py @ 5609:dccf9b7e5ee4
Fix CSV export with WSGI and Python 3 (issue2551019).
| author | Tom Ekberg <tekberg@uw.edu> |
|---|---|
| date | Sun, 10 Feb 2019 14:10:55 +0000 |
| parents | 3a07c57d72bb |
| children | 5579fa034f9e |
line wrap: on
line diff
--- a/roundup/cgi/wsgi_handler.py Fri Feb 08 19:39:17 2019 -0500 +++ b/roundup/cgi/wsgi_handler.py Sun Feb 10 14:10:55 2019 +0000 @@ -11,7 +11,7 @@ import roundup.instance from roundup.cgi import TranslationService from roundup.anypy import http_ -from roundup.anypy.strings import s2b +from roundup.anypy.strings import s2b, bs2b BaseHTTPRequestHandler = http_.server.BaseHTTPRequestHandler DEFAULT_ERROR_MESSAGE = http_.server.DEFAULT_ERROR_MESSAGE @@ -22,8 +22,8 @@ self.request = request #weakref.ref(request) def write(self, data): f = self.request.get_wfile() - self.write = f - return f(data) + self.write = lambda data: f(bs2b(data)) + return self.write(data) class RequestDispatcher(object): def __init__(self, home, debug=False, timing=False, lang=None):
