Skip to content

Fix non-native IO.popen env + kwargs handling#9351

Merged
headius merged 1 commit intojruby:jruby-9.4from
headius:fix_windows_popen_kwargs
Mar 31, 2026
Merged

Fix non-native IO.popen env + kwargs handling#9351
headius merged 1 commit intojruby:jruby-9.4from
headius:fix_windows_popen_kwargs

Conversation

@headius
Copy link
Copy Markdown
Member

@headius headius commented Mar 31, 2026

When both an env hash and a keyword arguments hash were provided here, the env hash logic would decrement argc resulting in the keyword arguments hash detection accessing the wrong argument. The fix here aligns this logic with the newer PopenExecutor and ensures the keyword arguments hash is handled first.

The argument processing logic for these two popen implementations should be unified, but this simple fix gets popen working better right now.

Fixes #9295

When both an env hash and a keyword arguments hash were provided
here, the env hash logic would decrement argc resulting in the
keyword arguments hash detection accessing the wrong argument. The
fix here aligns this logic with the newer PopenExecutor and ensures
the keyword arguments hash is handled first.

The argument processing logic for these two popen implementations
should be unified, but this simple fix gets popen working better
right now.

Fixes jruby#9295
@headius headius added this to the JRuby 9.4.15.0 milestone Mar 31, 2026
@headius headius changed the base branch from master to jruby-9.4 March 31, 2026 13:31
@headius headius merged commit 3615d58 into jruby:jruby-9.4 Mar 31, 2026
106 checks passed
@headius headius deleted the fix_windows_popen_kwargs branch March 31, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with calling IO.popen(env, cmd, opts) on Windows

1 participant