Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit756b7ad

Browse files
committed
BF: skip unicode filename test in env not supporting unicode encodings
1 parentd772924 commit756b7ad

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎git/test/test_base.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# This module is part of GitPython and is released under
66
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
77
importos
8+
importsys
89
importtempfile
910

1011
importgit.objects.baseasbase
@@ -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+
exceptUnicodeEncodeError:
125+
fromnoseimportSkipTest
126+
raiseSkipTest("Environment doesn't support unicode filenames")
127+
119128
open(file_path,"wb").write(b'something')
120129

121130
ifos.name=='nt':

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp