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 55# This module is part of GitPython and is released under
66# the BSD License: http://www.opensource.org/licenses/bsd-license.php
77import os
8+ import sys
89import tempfile
910
1011import git .objects .base as base
@@ -116,6 +117,14 @@ def test_add_unicode(self, rw_repo):
116117 filename = u"שלום.txt"
117118
118119 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+
119128 open (file_path , "wb" ).write (b'something' )
120129
121130 if os .name == 'nt' :
You can’t perform that action at this time.
0 commit comments