From c8b837923d506e265ff8bb79af61c0d86e7d5b2e Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 17 Aug 2015 22:39:13 +0200 Subject: 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 --- git/test/test_index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git/test/test_index.py') diff --git a/git/test/test_index.py b/git/test/test_index.py index 39788575..ffc4bffe 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -787,8 +787,8 @@ class TestIndex(TestBase): def test_add_utf8P_path(self, rw_dir): # NOTE: fp is not a Unicode object in python 2 (which is the source of the problem) fp = os.path.join(rw_dir, 'ø.txt') - with open(fp, 'w') as fs: - fs.write('content of ø') + with open(fp, 'wb') as fs: + fs.write(u'content of ø'.encode('utf-8')) r = Repo.init(rw_dir) r.index.add([fp]) -- cgit v1.2.1