Skip to content

fix: resolve Windows command wrappers before execution - #10999

Draft
Rishav23av wants to merge 1 commit into
python-poetry:mainfrom
Rishav23av:agent/windows-long-path-script
Draft

fix: resolve Windows command wrappers before execution#10999
Rishav23av wants to merge 1 commit into
python-poetry:mainfrom
Rishav23av:agent/windows-long-path-script

Conversation

@Rishav23av

Copy link
Copy Markdown

Pull Request Check List

Resolves: #10482

  • Added tests for changed code.
  • Updated documentation for changed code. No documentation change is needed for this internal command-resolution fix.

What changed

On Windows, Poetry now resolves .cmd wrappers in a virtual environment before handing the command to the shell. Existing .exe lookup keeps its current priority, and explicit .cmd arguments are handled too.

The existing editable-dependency command test now uses a PATH longer than the reported cmd.exe limit. Unit tests cover .exe precedence, .cmd fallback, and explicit suffixes.

Checks

  • pytest tests/utils/env/test_env.py tests/console/commands/test_run.py -p no:randomly — 58 passed, 1 Windows-only test skipped locally
  • mypy on the three changed files
  • ruff check --ignore FURB188 and ruff format --check on the three changed files
  • git diff --check

The long-PATH end-to-end assertion is Windows-only and will be exercised by CI. The implementation and review were assisted by Claude Code and Codex; I reviewed the final diff and test results.

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.

poetry run can fail for scripts defined in [project.scripts] if PATH is too long

1 participant