1 parent f0b3123 commit ba7e4eaCopy full SHA for ba7e4ea
1 file changed
python_agent_harness/tui.py
@@ -1263,7 +1263,8 @@ def _run_sessions(self) -> None:
1263
return
1264
for f in files:
1265
try:
1266
- text = open(f, encoding="utf-8").read()
+ with open(f, encoding="utf-8") as fh:
1267
+ text = fh.read()
1268
except OSError:
1269
continue
1270
meta = SessionStore.parse_metadata(text)
@@ -1302,7 +1303,8 @@ def _run_restore(self, arg: str) -> None:
1302
1303
self.console.print(f"[red]file not found: {path}[/red]")
1304
1305
- text = open(path, encoding="utf-8").read()
1306
+ with open(path, encoding="utf-8") as fh:
1307
1308
except OSError as e:
1309
self.console.print(f"[red]cannot read {path}: {e}[/red]")
1310
0 commit comments