From 93d530234a4f5533aa99c3b897bb56d375c2ae60 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 16 Oct 2016 14:34:03 +0200 Subject: fix(unicode): use surrogateescape in bytes.decode That way, we will try to decode as default encoding (usually utf-8), but allow ourselves to simply keep bytes that don't match within the resulting unicode string. That way, we allow for lossless decode/encode cycles while still assuring that decoding never fails. NOTE: I was too lazy to create a test that would verify it, but manually executed https://github.com/petertodd/gitpython-unicode-error. fixes #532 --- git/test/performance/test_commit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/test/performance/test_commit.py') diff --git a/git/test/performance/test_commit.py b/git/test/performance/test_commit.py index c60dc2fc..322d3c9f 100644 --- a/git/test/performance/test_commit.py +++ b/git/test/performance/test_commit.py @@ -52,7 +52,7 @@ class TestPerformance(TestBigRepoRW): # END for each object # END for each commit elapsed_time = time() - st - print("Traversed %i Trees and a total of %i unchached objects in %s [s] ( %f objs/s )" + print("Traversed %i Trees and a total of %i uncached objects in %s [s] ( %f objs/s )" % (nc, no, elapsed_time, no / elapsed_time), file=sys.stderr) def test_commit_traversal(self): -- cgit v1.2.1