Skip to content

fix: guarantee editor tempfile cleanup and add debug logging - #2106

Merged
alichtman merged 4 commits into
mainfrom
logging_and_reliability
Jul 20, 2026
Merged

alichtman merged 4 commits into
mainfrom
logging_and_reliability

Conversation

@alichtman

Copy link
Copy Markdown
Contributor
  • fix: guarantee editor tempfile cleanup on failure
  • feat: add debug logging to editor.py
  • feat: log the editor command when opening it in append mode

get_text_from_editor left the tempfile on disk if subprocess.call
raised (e.g. misconfigured editor), since os.remove only ran after a
successful read. Wrap the write/invoke/read in try/finally so the
tempfile is always removed.
get_text_from_editor had no logging despite spawning a subprocess and
doing disk I/O. Add debug logs around tempfile creation/cleanup and
editor invocation, an error log when the editor is misconfigured, and
a debug log in read_template_file's FileNotFoundError handler for
parity with the existing debug log in get_template_path.
@alichtman
alichtman merged commit 3269fa7 into main Jul 20, 2026
13 checks passed
@alichtman
alichtman deleted the logging_and_reliability branch July 20, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant