freemyipod r616 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r615‎ | r616 | r617 >
Date:04:51, 14 February 2011
Author:theseven
Status:new
Tags:
Comment:
misc.py: The logger will hopefully work on Python 2.x as well now...
Modified paths:
  • /emcore/trunk/tools/misc.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/misc.py
@@ -79,12 +79,12 @@
8080 if majorver() > 2:
8181 sys.stdout.write(text)
8282 else:
83 - sys.stdout.write(text.encode(sys.stdout.encoding, "replace"))
 83+ sys.stdout.write(text.encode(sys.stdout.encoding or "latin1", "replace"))
8484 if target == "stderr":
8585 if majorver() > 2:
8686 sys.stdout.write(text)
8787 else:
88 - sys.stderr.write(text.encode(sys.stderr.encoding, "replace"))
 88+ sys.stderr.write(text.encode(sys.stderr.encoding or "latin1", "replace"))
8989 elif target == "file":
9090 with open(self.logfile, 'a') as f:
9191 f.write(text)