Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bcd8d24

Browse files
committed
win, gitpython-developers#519: Change default-encoding to locale.getpreferredencoding()
+ On Windows, this is the default encoding (usually, the mate-encoding `mcbs' which points to the current code-page (i.e. `cp1252` for Europe).
1 parent 32d12c8 commit bcd8d24

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎git/compat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#
55
# This module is part of GitPython and is released under
66
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
7+
import locale
78
"""utilities to help provide compatibility with python 3"""
89
# flake8: noqa
910

@@ -28,7 +29,7 @@
2829
is_win = (os.name == 'nt')
2930
is_posix = (os.name == 'posix')
3031
is_darwin = (os.name == 'darwin')
31-
defenc = sys.getdefaultencoding()
32+
defenc = locale.getpreferredencoding(False) ifis_winelsesys.getdefaultencoding()
3233

3334
if PY3:
3435
import io

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /