From 09bdfd715a122515cd0835714c128710b05cd641 Mon Sep 17 00:00:00 2001 From: Jamie Lennox Date: Mon, 23 Sep 2013 17:23:39 +1000 Subject: [PATCH] fix: Add output encoding to tests for Python3 In certain environment setups python 3 will detect the appropriate output as ASCII and will fail when trying to write a unicode string. Override this by forcing UTF-8. --- falcon/tests/test_wsgi_errors.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/falcon/tests/test_wsgi_errors.py b/falcon/tests/test_wsgi_errors.py index 7f93500..26b78f6 100644 --- a/falcon/tests/test_wsgi_errors.py +++ b/falcon/tests/test_wsgi_errors.py @@ -27,7 +27,8 @@ class TestWSGIError(testing.TestBase): if six.PY3: # Simulate Gunicorn's behavior under Python 3 self.wsgierrors = io.TextIOWrapper(self.wsgierrors_buffer, - line_buffering=True) + line_buffering=True, + encoding='utf-8') else: # WSGI servers typically present an open file object, # with undefined encoding, so do the encoding manually.