Skip to content

fix(docx): use platform temp dir and stop claiming success on timeout in accept_changes.py - #1848

Closed
TINGyu123644 wants to merge 1 commit into
anthropics:mainfrom
TINGyu123644:fix/docx-accept-changes-tmp-timeout
Closed

TINGyu123644 wants to merge 1 commit into
anthropics:mainfrom
TINGyu123644:fix/docx-accept-changes-tmp-timeout

Conversation

@TINGyu123644

Copy link
Copy Markdown

Two real defects in accept_changes.py:

  1. LIBREOFFICE_PROFILE = "/tmp/libreoffice_docx_profile" is a hard-coded Unix path. On Windows (which this repo's office scripts explicitly support elsewhere) /tmp does not exist, so LibreOffice cannot create its user profile and the macro never runs. Use the platform temp dir instead.
  2. A TimeoutExpired from subprocess.run(..., timeout=30) is reported as "Successfully accepted all tracked changes", even though the file was only copied and never processed. Report a timeout honestly instead of claiming success.

Verified: python -m py_compile passes.

@TINGyu123644

Copy link
Copy Markdown
Author

Closing: the timeout-handling half of this change overlaps with #1792 (which already fixes the "success on timeout" defect from #1770 and was reviewed). The /tmp->platform-temp-dir half is kept for the maintainers' consideration — happy to resubmit it alone if wanted.

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