From 3953d71374994a00c7ef756040d2c77090f07bb4 Mon Sep 17 00:00:00 2001 From: xarx00 Date: Fri, 5 Apr 2019 23:42:55 +0200 Subject: [PATCH 1/3] added support for non-ascii directories and file names --- git/compat.py | 5 ++++- git/repo/base.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/git/compat.py b/git/compat.py index b63768f3d..02dc69de8 100644 --- a/git/compat.py +++ b/git/compat.py @@ -30,7 +30,10 @@ 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 diff --git a/git/repo/base.py b/git/repo/base.py index 58f11e51e..993e091d0 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -4,6 +4,7 @@ # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php +from builtins import str from collections import namedtuple import logging import os From a6f596d7f46cb13a3d87ff501c844c461c0a3b0a Mon Sep 17 00:00:00 2001 From: xarx00 Date: Sat, 6 Apr 2019 01:15:49 +0200 Subject: [PATCH 2/3] Fix for: No module named builtins (CI tests error) --- git/repo/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git/repo/base.py b/git/repo/base.py index 993e091d0..b8ee8357e 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -4,7 +4,7 @@ # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php -from builtins import str +from __builtins__ import str from collections import namedtuple import logging import os From a77eab2b5668cd65a3230f653f19ee00c34789bf Mon Sep 17 00:00:00 2001 From: xarx00 Date: Sat, 6 Apr 2019 01:35:46 +0200 Subject: [PATCH 3/3] builtins module is part of the future package --- git/repo/base.py | 2 +- requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/git/repo/base.py b/git/repo/base.py index b8ee8357e..993e091d0 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -4,7 +4,7 @@ # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php -from __builtins__ import str +from builtins import str from collections import namedtuple import logging import os diff --git a/requirements.txt b/requirements.txt index 396446062..d07518bbd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ gitdb>=0.6.4 ddt>=1.1.1 +future>=0.9