diff options
| author | Georg Brandl <georg@python.org> | 2014-01-11 09:07:11 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2014-01-11 09:07:11 +0100 |
| commit | 818f76e027a2f4f7ea44dcf8dc70bee2a3118d8b (patch) | |
| tree | 00ede1c38f2adde35fd2754de3d3cd078679ada5 /sphinx/util | |
| parent | 4238b992b5e047c00a8a94df263e64fc8d1260db (diff) | |
| download | sphinx-818f76e027a2f4f7ea44dcf8dc70bee2a3118d8b.tar.gz | |
Closes #908: On Python 3, handle error messages from LaTeX correctly in the pngmath extension.
Diffstat (limited to 'sphinx/util')
| -rw-r--r-- | sphinx/util/pycompat.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py index 3d252c91..1e5ea314 100644 --- a/sphinx/util/pycompat.py +++ b/sphinx/util/pycompat.py @@ -30,6 +30,9 @@ if sys.version_info >= (3, 0): # safely encode a string for printing to the terminal def terminal_safe(s): return s.encode('ascii', 'backslashreplace').decode('ascii') + # some kind of default system encoding; should be used with a lenient + # error handler + sys_encoding = sys.getdefaultencoding() # support for running 2to3 over config files def convert_with_2to3(filepath): from lib2to3.refactor import RefactoringTool, get_fixers_from_package @@ -62,6 +65,10 @@ else: # safely encode a string for printing to the terminal def terminal_safe(s): return s.encode('ascii', 'backslashreplace') + # some kind of default system encoding; should be used with a lenient + # error handler + import locale + sys_encoding = locale.getpreferredencoding() def execfile_(filepath, _globals): |
