diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-08-17 22:39:13 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-08-17 22:39:13 +0200 |
commit | c8b837923d506e265ff8bb79af61c0d86e7d5b2e (patch) | |
tree | 43d0afec5768168b3c686dd5b4cb3f592cfe3da8 | |
parent | a8f7e3772f68c8e6350b9ff5ac981ba3223f2d43 (diff) | |
download | gitpython-c8b837923d506e265ff8bb79af61c0d86e7d5b2e.tar.gz |
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
-rw-r--r-- | git/test/test_index.py | 4 |
1 files changed, 2 insertions, 2 deletions
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]) |