diff options
Diffstat (limited to 'cherrypy/test/test_conn.py')
-rw-r--r-- | cherrypy/test/test_conn.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cherrypy/test/test_conn.py b/cherrypy/test/test_conn.py index 703e6dfd..6577e03a 100644 --- a/cherrypy/test/test_conn.py +++ b/cherrypy/test/test_conn.py @@ -8,7 +8,14 @@ import errno import cherrypy from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, NotConnected -from cherrypy._cpcompat import BadStatusLine, ntob, tonative, urlopen, unicodestr +from cherrypy._cpcompat import ( + BadStatusLine, + ntob, + tonative, + urlopen, + unicodestr, + py3k +) from cherrypy.test import webtest @@ -434,6 +441,12 @@ class PipelineTests(helper.CPWebCase): # Retrieve previous response response = conn.response_class(conn.sock, method="GET") + # there is a bug in python3 regarding the buffering of + # ``conn.sock``. Until that bug get's fixed we will + # monkey patch the ``reponse`` instance. + # https://bugs.python.org/issue23377 + if py3k: + response.fp = conn.sock.makefile("rb", 0) response.begin() body = response.read(13) self.assertEqual(response.status, 200) |