浏览代码

Encode with filesystemencoding.

Jelmer Vernooij 9 年之前
父节点
当前提交
b8ae63e4c9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      dulwich/refs.py

+ 1 - 1
dulwich/refs.py

@@ -398,7 +398,7 @@ class DiskRefsContainer(RefsContainer):
             dir = root[len(path):].strip(os.path.sep).replace(os.path.sep, "/")
             for filename in files:
                 refname = (("%s/%s" % (dir, filename))
-                           .strip("/").encode('ascii'))
+                           .strip("/").encode(sys.getfilesystemencoding()))
                 # check_ref_format requires at least one /, so we prepend the
                 # base before calling it.
                 if check_ref_format(base + b'/' + refname):