diff options
author | Ian Bicking <ian@ianbicking.org> | 2005-09-09 18:04:31 +0000 |
---|---|---|
committer | Ian Bicking <ian@ianbicking.org> | 2005-09-09 18:04:31 +0000 |
commit | c77c1a39837bc89fd04ce822558533ee8a80ef8b (patch) | |
tree | 7b6e079024c32e9c5e9dda72437ee25a3e953a04 | |
parent | 4a692c6ff2a249ec1a135d435f5886a8bbdaee89 (diff) | |
download | paste-git-c77c1a39837bc89fd04ce822558533ee8a80ef8b.tar.gz |
Handle unicode printing; don't capture when run in a unit testing environment
-rw-r--r-- | paste/printdebug.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/paste/printdebug.py b/paste/printdebug.py index 381c831..00915ad 100644 --- a/paste/printdebug.py +++ b/paste/printdebug.py @@ -19,6 +19,9 @@ class TeeFile(object): self.files = files def write(self, v): + if isinstance(v, unicode): + # WSGI is picky in this case + v = str(v) for file in self.files: file.write(v) @@ -44,6 +47,10 @@ class PrintDebugMiddleware(object): def __call__(self, environ, start_response): global _threadedprint_installed + if environ.get('paste.testing'): + # In a testing environment this interception isn't + # useful: + return self.app(environ, start_response) if not _threadedprint_installed: # @@: Not strictly threadsafe _threadedprint_installed = True |