File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 5
5
# This module is part of GitPython and is released under
6
6
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
7
7
import os
8
+ import sys
8
9
import tempfile
9
10
10
11
import git .objects .base as base
@@ -116,6 +117,14 @@ def test_add_unicode(self, rw_repo):
116
117
filename = u"שלום.txt"
117
118
118
119
file_path = os .path .join (rw_repo .working_dir , filename )
120
+
121
+ # verify first that we could encode file name in this environment
122
+ try :
123
+ _ = file_path .encode (sys .getfilesystemencoding ())
124
+ except UnicodeEncodeError :
125
+ from nose import SkipTest
126
+ raise SkipTest ("Environment doesn't support unicode filenames" )
127
+
119
128
open (file_path , "wb" ).write (b'something' )
120
129
121
130
if os .name == 'nt' :
You can’t perform that action at this time.
0 commit comments