« Previous | Next » 

Revision e44de63f

IDe44de63f438f151c017e2726ad11464949f281b9

Added by Christos Stavrakakis over 11 years ago

Fix UnicodeError when writing to sys.stdout

Due to a bug the was fixed in Python-2.7, in Python-2.6 unicode strings
that are written to sys.stdout (using sys.stdout.write) are not
converted to bytestrings using the file.encoding. Instead
sys.stdout.encoding is set to None, and the default encoding is used. We
solve this by creating a wrapper to stdout, and encoding everything
either with the file encoding, or with the `locale` prefered encoding.

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences