We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
locale.getpreferredencoding()
1 parent 32d12c8 commit bcd8d24Copy full SHA for bcd8d24
git/compat.py
@@ -4,6 +4,7 @@
4
#
5
# This module is part of GitPython and is released under
6
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
7
+import locale
8
"""utilities to help provide compatibility with python 3"""
9
# flake8: noqa
10
@@ -28,7 +29,7 @@
28
29
is_win = (os.name == 'nt')
30
is_posix = (os.name == 'posix')
31
is_darwin = (os.name == 'darwin')
-defenc = sys.getdefaultencoding()
32
+defenc = locale.getpreferredencoding(False) if is_win else sys.getdefaultencoding()
33
34
if PY3:
35
import io
0 commit comments