Commits

Anonymous committed 4fb767f

Handle unicode printing; don't capture when run in a unit testing environment

  • Participants
  • Parent commits cfc06f8
  • Branches mainline-refactor

Comments (0)

Files changed (1)

File paste/printdebug.py

         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)
 
 
     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