Skip to content

Commit 8aa0212

Browse files
committed
WIP: more windoes shenanigans
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
1 parent a8d2e81 commit 8aa0212

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/test_updater_top_level_update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ def test_load_metadata_from_cache(self, wrapped_open: MagicMock) -> None:
712712
root_dir = os.path.join(self.metadata_dir, "root_history")
713713
wrapped_open.assert_has_calls(
714714
[
715-
call(os.path.join(self.metadata_dir, ".lock"), "x+b"),
715+
call(os.path.join(self.metadata_dir, ".lock"), "wb"),
716716
call(os.path.join(root_dir, "2.root.json"), "rb"),
717717
call(os.path.join(self.metadata_dir, "timestamp.json"), "rb"),
718718
call(os.path.join(self.metadata_dir, "snapshot.json"), "rb"),

tuf/ngclient/updater.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def _lock_metadata(self) -> Iterator[None]:
172172
rootdir = Path(self._dir, "root_history")
173173
rootdir.mkdir(exist_ok=True, parents=True)
174174
logger.debug("Getting metadata lock...")
175-
with open(os.path.join(self._dir, ".lock"), "a+") as f:
175+
with open(os.path.join(self._dir, ".lock"), "wb") as f:
176176
_lock_file(f)
177177
yield
178178
logger.debug("Released metadata lock")

0 commit comments

Comments
 (0)