Skip to content

fix: write extraction bundle to a temp dir so Windows can open it - #95

Merged
mrchtr merged 1 commit into
mainfrom
fix/windows-extract-tempfile
Oct 23, 2026
Merged

mrchtr merged 1 commit into
mainfrom
fix/windows-extract-tempfile

Conversation

@mrchtr

@mrchtr mrchtr commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Problem

On Windows, deploy / validate / run on a .py pipeline fail with PermissionError: [Errno 13].

extract_via_subprocess opened a NamedTemporaryFile(delete=True) and passed its name to the extractor subprocess. On Windows that file stays locked while the handle is open, so the child cannot write the JSON bundle to it. POSIX doesn't lock, so it never showed up on macOS/Linux.

Fix

Use a TemporaryDirectory and write to a plain path inside it, so nothing holds the file open while the subprocess writes. All .py build paths go through this one function.

Testing

  • pytest tests/unit/service/test_pipeline_transform.py -k extract_via_subprocess (real subprocess round-trip) passes; mypy clean.
  • Not verified on a Windows machine (no Windows CI). Please check with haystack-enterprise deploy pipeline.py SVC --dry-run --output out.yaml.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LtM12smTaqz8gw7jsc5vGT

NamedTemporaryFile(delete=True) holds the file open and locked on
Windows, so the extractor subprocess failed with PermissionError when
writing the bundle. Use a TemporaryDirectory and a plain path instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack_enterprise_sdk/_service
  pipeline_transform.py 537
Project Total  

This report was generated by python-coverage-comment-action

@volkanarisli volkanarisli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mrchtr
mrchtr merged commit 857ab5c into main Oct 23, 2026
6 checks passed
@mrchtr
mrchtr deleted the fix/windows-extract-tempfile branch October 23, 2026 08:51
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.

2 participants