We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 69cdf75 commit 2aab2f2Copy full SHA for 2aab2f2
src/pip/_internal/cache.py
@@ -34,7 +34,7 @@ def _hash_dict(d):
34
for k in sorted(d.keys()):
35
h.update(k.encode())
36
h.update("=".encode())
37
- h.update(d[k].encode())
+ h.update(d[k].encode("utf-8"))
38
h.update(b"\0")
39
return h.hexdigest()
40
tests/unit/test_cache.py
@@ -49,6 +49,8 @@ def test_cache_hash():
49
assert h == "c7d60d08b1079254d236e983501fa26c016d58d16010725b27ed0af2"
50
h = _hash_dict({"url": "https://g.c/o/r", "subdirectory": "sd"})
51
assert h == "9cba35d4ccf04b7cde751b44db347fd0f21fa47d1276e32f9d47864c"
52
+ h = _hash_dict({"subdirectory": u"/\xe9e"})
53
+ assert h == "727d53e3305684344078965b1c0771f57f180c00516aaeb6ed8b36ce"
54
55
56
def test_get_path_for_link_legacy(tmpdir):
0 commit comments