From 0d0ce10a1c448f8e543f8a443694a7fe00d7a488 Mon Sep 17 00:00:00 2001 From: doronz Date: Sun, 19 Nov 2023 09:21:19 +0200 Subject: [PATCH] fs: make `write_file()` truncate the file --- src/rpcclient/rpcclient/fs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcclient/rpcclient/fs.py b/src/rpcclient/rpcclient/fs.py index bd0d56a1..eee522ae 100644 --- a/src/rpcclient/rpcclient/fs.py +++ b/src/rpcclient/rpcclient/fs.py @@ -350,7 +350,7 @@ def open(self, file: str, mode: str, access: int = 0o777) -> File: @path_to_str('file') def write_file(self, file: str, buf: bytes, access: int = 0o777): - with self.open(file, 'w+', access=access) as f: + with self.open(file, 'w', access=access) as f: f.write(buf) @path_to_str('file')