diff options
author | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-07-20 15:22:32 +0800 |
---|---|---|
committer | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-07-20 15:22:32 +0800 |
commit | 3b13c115994461fb6bafe5dd06490aae020568c1 (patch) | |
tree | 9a1e0a8fc9ec0e8bdb7554def440b642ac303a2c /git/compat.py | |
parent | da8aeec539da461b2961ca72049df84bf30473e1 (diff) | |
parent | a77eab2b5668cd65a3230f653f19ee00c34789bf (diff) | |
download | gitpython-3b13c115994461fb6bafe5dd06490aae020568c1.tar.gz |
Merge branch 'PR-non-ascii-filenames' of https://github.com/xarx00/GitPython into xarx00-PR-non-ascii-filenames
Diffstat (limited to 'git/compat.py')
-rw-r--r-- | git/compat.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/git/compat.py b/git/compat.py index b63768f3..02dc69de 100644 --- a/git/compat.py +++ b/git/compat.py @@ -30,7 +30,10 @@ PY3 = sys.version_info[0] >= 3 is_win = (os.name == 'nt') is_posix = (os.name == 'posix') is_darwin = (os.name == 'darwin') -defenc = sys.getdefaultencoding() +if hasattr(sys, 'getfilesystemencoding'): + defenc = sys.getfilesystemencoding() +if defenc is None: + defenc = sys.getdefaultencoding() if PY3: import io |