Blob Blame History Raw
From 4e53fa958a2ad8d188ee921aebcb3943073e2850 Mon Sep 17 00:00:00 2001
From: Jamie Lennox <jamielennox@redhat.com>
Date: Mon, 23 Sep 2013 17:23:39 +1000
Subject: [PATCH] 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.
-- 
1.8.3.1