Skip to content

fix(local): remove duplicate creationflags in _run_bash() on Windows#28898

Open
EloquentBrush0x wants to merge 1 commit into
NousResearch:mainfrom
EloquentBrush0x:fix/local-env-duplicate-creationflags-28874
Open

fix(local): remove duplicate creationflags in _run_bash() on Windows#28898
EloquentBrush0x wants to merge 1 commit into
NousResearch:mainfrom
EloquentBrush0x:fix/local-env-duplicate-creationflags-28874

Conversation

@EloquentBrush0x

Copy link
Copy Markdown
Contributor

What does this PR do?

Root cause: #28874 added _popen_kwargs = {"creationflags": windows_hide_flags()} if _IS_WINDOWS else {} and **_popen_kwargs to the subprocess.Popen call in LocalEnvironment._run_bash(), but did not remove the pre-existing explicit argument:

creationflags=subprocess.CREATE_NO_WINDOW if _IS_WINDOWS else 0,

On Windows, Python raises TypeError: Popen.__init__() got multiple values for keyword argument 'creationflags' on every shell command execution — _run_bash() is completely broken.

Fix: remove the stale explicit creationflags= argument so **_popen_kwargs is the sole source of creationflags, matching the pattern already applied correctly in tools/process_registry.py (line 566) by the same PR.

Related Issue

Regression introduced in #28874.

Type of Change

  • 🐛 Bug fix

Changes Made

  • tools/environments/local.py: remove duplicate creationflags=subprocess.CREATE_NO_WINDOW if _IS_WINDOWS else 0 keyword argument from subprocess.Popen call in _run_bash() (-1 line)

How to Test

python3.11 -m pytest tests/tools/test_local_env_windows_msys.py tests/tools/test_local_env_blocklist.py -v --override-ini="addopts="

Checklist

  • Contributing Guide read | Conventional Commits | No duplicate PR
  • Single fix only | Platform: macOS
  • Docs — N/A | Cross-platform — Windows crash fix

_run_bash() passes both an explicit
`creationflags=subprocess.CREATE_NO_WINDOW if _IS_WINDOWS else 0`
keyword argument and `**_popen_kwargs` which on Windows contains
`{"creationflags": windows_hide_flags()}`. Python raises
`TypeError: Popen.__init__() got multiple values for keyword argument
'creationflags'` for every shell command on Windows.

Introduced in NousResearch#28874, which correctly removed the legacy
`creationflags=` line in `process_registry.py` but left it in
`local.py`. Fix: remove the stale explicit argument so `**_popen_kwargs`
is the sole source of `creationflags`, matching the pattern already in
`tools/process_registry.py` (line 566).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend/local Local shell execution P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants