소스 검색

readlink on Windows/python3 requires a unicode string.

Jelmer Vernooij 8 년 전
부모
커밋
7f5e503923
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      dulwich/index.py

+ 3 - 0
dulwich/index.py

@@ -545,6 +545,9 @@ def blob_from_path_and_stat(fs_path, st):
         with open(fs_path, 'rb') as f:
             blob.data = f.read()
     else:
+        if sys.platform == 'win32' and sys.version_info[0] == 3:
+            # os.readlink on Python3 on Windows requires a unicode string.
+            fs_path = fs_path.decode(sys.getfilesystemencoding())
         blob.data = os.readlink(fs_path)
     return blob