auto-sync: 2026-05-17 06:32:52
This commit is contained in:
+2
-2
@@ -168,8 +168,8 @@ class InboxWatcher:
|
||||
def _truncate(self) -> None:
|
||||
"""清空文件内容(不删除文件)"""
|
||||
try:
|
||||
with open(self.inbox_path, "w", encoding="utf-8") as f:
|
||||
f.truncate(0)
|
||||
with open(self.inbox_path, "w", encoding="utf-8"):
|
||||
pass # "w" mode already truncates
|
||||
except OSError:
|
||||
logger.exception("Failed to truncate inbox: %s", self.inbox_path)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user