summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Schetinin <sergey@maluke.com>2011-10-02 02:30:56 +0300
committerSergey Schetinin <sergey@maluke.com>2011-10-02 02:30:56 +0300
commit919c36d1d2821f0559b36fecb657229f1e4c4783 (patch)
tree775dc481b18b4b943e3e4d9bd8e8999ab18b1600
parente18643688267a7762ad12e4db263ff7bfa47b33b (diff)
downloadwebob-919c36d1d2821f0559b36fecb657229f1e4c4783.tar.gz
fix str(Response()) w/o charset, but only on py2
-rw-r--r--.gitignore2
-rw-r--r--tests/test_in_wsgiref.py1
-rw-r--r--tests/test_response.py2
-rw-r--r--webob/response.py3
4 files changed, 5 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index cf073b2..521370c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,5 @@ Session.vim
coverage.xml
nosetests.xml
env32/
+
+_website/ \ No newline at end of file
diff --git a/tests/test_in_wsgiref.py b/tests/test_in_wsgiref.py
index e2d0471..fdd56ac 100644
--- a/tests/test_in_wsgiref.py
+++ b/tests/test_in_wsgiref.py
@@ -1,4 +1,3 @@
-from __future__ import with_statement
import sys
import logging
import threading
diff --git a/tests/test_response.py b/tests/test_response.py
index 7509271..1f9422c 100644
--- a/tests/test_response.py
+++ b/tests/test_response.py
@@ -342,6 +342,8 @@ def test_from_file():
res = Response('test')
inp = io.BytesIO(bytes_(str(res)))
equal_resp(res, inp)
+
+def test_from_file2():
res = Response(app_iter=iter([b'test ', b'body']),
content_type='text/plain')
inp = io.BytesIO(bytes_(str(res)))
diff --git a/webob/response.py b/webob/response.py
index 85179d2..a454dae 100644
--- a/webob/response.py
+++ b/webob/response.py
@@ -214,10 +214,9 @@ class Response(object):
self.body
parts += map('%s: %s'.__mod__, self.headerlist)
if not skip_body and self.body:
- parts += ['', self.text]
+ parts += ['', self.text if PY3 else self.body]
return '\n'.join(parts)
-
#
# status, status_int
#