diff --git a/tools/environments/local.py b/tools/environments/local.py index 1029545f..448fe024 100644 --- a/tools/environments/local.py +++ b/tools/environments/local.py @@ -392,7 +392,8 @@ class LocalEnvironment(BaseEnvironment): def _update_cwd(self, result: dict): """Read CWD from temp file (local-only, no round-trip needed).""" try: - cwd_path = open(self._cwd_file).read().strip() + with open(self._cwd_file) as f: + cwd_path = f.read().strip() if cwd_path: self.cwd = cwd_path except (OSError, FileNotFoundError):