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

Lines changed: 2 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy