summaryrefslogtreecommitdiff
path: root/git/test/test_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/test/test_base.py')
-rw-r--r--git/test/test_base.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/git/test/test_base.py b/git/test/test_base.py
index 91b9d005..72f2d554 100644
--- a/git/test/test_base.py
+++ b/git/test/test_base.py
@@ -5,6 +5,7 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import os
+import sys
import tempfile
import git.objects.base as base
@@ -116,6 +117,14 @@ class TestBase(TestBase):
filename = u"שלום.txt"
file_path = os.path.join(rw_repo.working_dir, filename)
+
+ # verify first that we could encode file name in this environment
+ try:
+ _ = file_path.encode(sys.getfilesystemencoding())
+ except UnicodeEncodeError:
+ from nose import SkipTest
+ raise SkipTest("Environment doesn't support unicode filenames")
+
open(file_path, "wb").write(b'something')
if os.name == 'nt':