diff options
author | ianb <devnull@localhost> | 2006-02-28 00:04:17 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2006-02-28 00:04:17 +0000 |
commit | beb6deb1dd0680a785699cbd89190b4d084bd74f (patch) | |
tree | 064b9517ccb02502ecfac5535c47bc4cdf72787f /paste/wsgilib.py | |
parent | feffdb13f961325ff252617509d92644dbca997e (diff) | |
download | paste-beb6deb1dd0680a785699cbd89190b4d084bd74f.tar.gz |
Don't use StringIO in wsgilib.raw_interactive, as apparently it encodes its content as ASCII (?)
Diffstat (limited to 'paste/wsgilib.py')
-rw-r--r-- | paste/wsgilib.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/paste/wsgilib.py b/paste/wsgilib.py index 2aae5e5..8b11035 100644 --- a/paste/wsgilib.py +++ b/paste/wsgilib.py @@ -199,7 +199,7 @@ def raw_interactive(application, path='', **environ): basic_environ['wsgi.input'] = StringIO(istream) basic_environ['CONTENT_LENGTH'] = len(istream) data = {} - output = StringIO() + output = [] headers_set = [] headers_sent = [] def start_response(status, headers, exc_info=None): @@ -221,7 +221,7 @@ def raw_interactive(application, path='', **environ): headers_set.append(True) data['status'] = status data['headers'] = headers - return output.write + return output.append app_iter = application(basic_environ, start_response) try: try: @@ -229,7 +229,7 @@ def raw_interactive(application, path='', **environ): headers_sent.append(True) if not headers_set: raise AssertionError("Content sent w/o headers!") - output.write(s) + output.append(s) except TypeError, e: # Typically "iteration over non-sequence", so we want # to give better debugging information... @@ -238,7 +238,7 @@ def raw_interactive(application, path='', **environ): finally: if hasattr(app_iter, 'close'): app_iter.close() - return (data['status'], data['headers'], output.getvalue(), + return (data['status'], data['headers'], ''.join(output), errors.getvalue()) def interactive(*args, **kw): |