Skip to content

Commit 85388e8

Browse files
committed
Fix CSV export with WSGI and Python 3 (issue2551019).
1 parent e4f7fa2 commit 85388e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

roundup/cgi/wsgi_handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import roundup.instance
1212
from roundup.cgi import TranslationService
1313
from roundup.anypy import http_
14-
from roundup.anypy.strings import s2b
14+
from roundup.anypy.strings import s2b, bs2b
1515
BaseHTTPRequestHandler = http_.server.BaseHTTPRequestHandler
1616
DEFAULT_ERROR_MESSAGE = http_.server.DEFAULT_ERROR_MESSAGE
1717

@@ -22,8 +22,8 @@ def __init__(self, request):
2222
self.request = request #weakref.ref(request)
2323
def write(self, data):
2424
f = self.request.get_wfile()
25-
self.write = f
26-
return f(data)
25+
self.write = lambda data: f(bs2b(data))
26+
return self.write(data)
2727

2828
class RequestDispatcher(object):
2929
def __init__(self, home, debug=False, timing=False, lang=None):

0 commit comments

Comments
 (0)