Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 11th, 2012  |  syntax: None  |  size: 0.85 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff --git src/python-sitelib/sitepyxpcom.py src/python-sitelib/sitepyxpcom.py
  2. index 994b60d..5a8f6f6 100644
  3. --- src/python-sitelib/sitepyxpcom.py
  4. +++ src/python-sitelib/sitepyxpcom.py
  5. @@ -18,7 +18,7 @@ output is written to the console.
  6.  
  7.  import os
  8.  import sys
  9. -
  10. +import codecs
  11.  
  12.  def redirect_std_handles():
  13.      stdout_log_name = "pystdout.log"
  14. @@ -43,8 +43,8 @@ def redirect_std_handles():
  15.      if log_dir is not None:
  16.          stdout_log_path = os.path.join(log_dir, stdout_log_name)
  17.          stderr_log_path = os.path.join(log_dir, stderr_log_name)
  18. -        sys.stdout = open(stdout_log_path, "w")
  19. -        sys.stderr = open(stderr_log_path, "w")
  20. +        sys.stdout = codecs.open(stdout_log_path, "w", "UTF-8")
  21. +        sys.stderr = codecs.open(stderr_log_path, "w", "UTF-8")
  22.      else:
  23.          # Fallback to "writing" to /dev/null.
  24.          class NullWriter: