From 154fac536c1207e42fd72de635646a5fcd5e2d68 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Fri, 8 Aug 2025 08:51:00 +0100 Subject: [PATCH] pipcl.py: two small fixes. git_get(): fix parsing of 'git:...'. NewFiles: fix use of hashlib on python < 3.11. --- pipcl.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pipcl.py b/pipcl.py index 566ac1798..fd737b0e4 100644 --- a/pipcl.py +++ b/pipcl.py @@ -2045,7 +2045,7 @@ def git_get( tag == next(args) branch = None else: - remote = next(args) + remote = arg assert remote, f'{default_remote=} and no remote specified in remote={remote0!r}.' assert branch or tag, f'{branch=} {tag=} and no branch/tag specified in remote={remote0!r}.' @@ -2940,7 +2940,10 @@ def get_one(self): def _file_id(self, path): mtime = os.stat(path).st_mtime with open(path, 'rb') as f: - hash_ = hashlib.file_digest(f, hashlib.md5).digest() + content = f.read() + hash_ = hashlib.md5(content).digest() + # With python >= 3.11 we can do: + #hash_ = hashlib.file_digest(f, hashlib.md5).digest() return mtime, hash_ def _items(self): ret = dict()