summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-08-17 22:39:13 +0200
committerSebastian Thiel <byronimo@gmail.com>2015-08-17 22:39:13 +0200
commitc8b837923d506e265ff8bb79af61c0d86e7d5b2e (patch)
tree43d0afec5768168b3c686dd5b4cb3f592cfe3da8
parenta8f7e3772f68c8e6350b9ff5ac981ba3223f2d43 (diff)
downloadgitpython-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.py4
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])