UTF-8 encode Twisted logs (allenap)

This commit is contained in:
Jonathan Lange 2016-04-30 09:50:10 +01:00
parent 73a88b7c56
commit 52b5d19191
1 changed files with 2 additions and 2 deletions

View File

@ -173,8 +173,8 @@ class CaptureTwistedLogs(Fixture):
logs = StringIO()
full_observer = log.FileLogObserver(logs)
self.useFixture(_TwistedLogObservers([full_observer.emit]))
self.addDetail(self.LOG_DETAIL_NAME,
Content(UTF8_TEXT, lambda: [logs.getvalue()]))
self.addDetail(self.LOG_DETAIL_NAME, Content(
UTF8_TEXT, lambda: [logs.getvalue().encode("utf-8")]))
def run_with_log_observers(observers, function, *args, **kwargs):