dabo Commit
Revision 4968
Date: 2009-01-25 13:39:09 -0800 (Sun, 25 Jan 2009)
Author: Cito
Trac: http://trac.dabodev.com/changeset/4968

Changed:
U   trunk/dabo/lib/logger.py

Log:
Try harder not to fail because of encoding problems when writing logs.

Diff:
Modified: trunk/dabo/lib/logger.py
===================================================================
--- trunk/dabo/lib/logger.py    2009-01-25 21:04:02 UTC (rev 4967)
+++ trunk/dabo/lib/logger.py    2009-01-25 21:39:09 UTC (rev 4968)
@@ -45,6 +45,11 @@
                        self.LogObject.write(msg)
                except UnicodeEncodeError:
                        self.LogObject.write(msg.encode('utf-8'))
+               except UnicodeDecodeError:
+                       try:
+                               self.LogObject.write(msg.decode('utf-8'))
+                       except UnicodeDecodeError:
+                               self.LogObject.write(msg.decode('latin-1'))
                # Flush the log entry to the file
                try:
                        self.LogObject.flush()



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to