Browse 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 11 years ago
parent
commit
8ea6412d92
1 changed files with 1 additions and 1 deletions
  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