]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix --checksum true
authorManuel Mausz <manuel@mausz.at>
Thu, 2 Feb 2023 12:40:56 +0000 (12:40 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 2 Feb 2023 15:57:02 +0000 (16:57 +0100)
File should be opened for reading

mkosi/__init__.py

index caf596f0dac9411287e2814e47028f0190b1beaf..86e05493a366d34d36acf7b5350fe7134ca25b6b 100644 (file)
@@ -1164,7 +1164,7 @@ def hash_file(of: TextIO, path: Path) -> None:
     bs = 16 * 1024**2
     h = hashlib.sha256()
 
-    with path.open("wb") as sf:
+    with path.open("rb") as sf:
         while (buf := sf.read(bs)):
             h.update(buf)