Skip to content

Commit c8b8379

Browse files
committed
fix(test_index): fix encoding
I really never want to touch python again, and never deal with py2/3 unicode handling anymore. By now, it seems pretty much anything is better. Is python to be blamed for it entirely ? Probably not, but there are better alternatives. Nim ? Rust ? Ruby ? Totally
1 parent a8f7e37 commit c8b8379

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎git/test/test_index.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -787,8 +787,8 @@ def test_index_bare_add(self, rw_bare_repo):
787787
def test_add_utf8P_path(self, rw_dir):
788788
# NOTE: fp is not a Unicode object in python 2 (which is the source of the problem)
789789
fp = os.path.join(rw_dir, 'ø.txt')
790-
with open(fp, 'w') as fs:
791-
fs.write('content of ø')
790+
with open(fp, 'wb') as fs:
791+
fs.write(u'content of ø'.encode('utf-8'))
792792

793793
r = Repo.init(rw_dir)
794794
r.index.add([fp])

0 commit comments

Comments
 (0)