Parcourir la source

Cron task: make sure log output is encoded to utf-8 before printing

In python, if stdout is not a tty (e.g piped output), then the output
encoding will fall back to the 'ascii' codec.
Gu1 il y a 11 ans
Parent
commit
8ea6412d92
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      ffdnispdb/cron_task.py

+ 1 - 1
ffdnispdb/cron_task.py

@@ -131,7 +131,7 @@ try:
                     print u'    three strikes, you\'re out'
                     send_warning_email(isp, log)
 
-                print log.rstrip()+'\n'
+                print log.rstrip().encode('utf-8')+'\n'
                 if exc:
                     print u'Unexpected exception in the validator: %r' % exc
                     print exc_log