Skip to content

fix(env): Return None in the get_str on unset vars#987

Closed
lu-zero wants to merge 1 commit intoreubeno:mainfrom
lu-zero:fix-get_str-behaviour
Closed

fix(env): Return None in the get_str on unset vars#987
lu-zero wants to merge 1 commit intoreubeno:mainfrom
lu-zero:fix-get_str-behaviour

Conversation

@lu-zero
Copy link
Copy Markdown
Contributor

@lu-zero lu-zero commented Feb 11, 2026

Fixes IFS handling when unset in local scope and potentially makes the HOME fallback more correct.

The get_str method was incorrectly converting unset variables to empty strings instead of returning None. This caused issues with IFS handling where unset IFS variables should fall back to default behavior but were instead treated as empty IFS.

Fixes IFS handling when unset in local scope and potentially makes the
HOME fallback more correct.

The get_str method was incorrectly converting unset variables to empty strings
instead of returning None. This caused issues with IFS handling where unset
IFS variables should fall back to default behavior but were instead treated
as empty IFS.
@github-actions
Copy link
Copy Markdown

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
clone_shell_object 16.91 μs 17.19 μs 0.28 μs 🟠 +1.64%
eval_arithmetic 0.16 μs 0.16 μs -0.00 μs ⚪ Unchanged
expand_one_string 1.56 μs 1.55 μs -0.01 μs ⚪ Unchanged
for_loop 23.70 μs 24.13 μs 0.44 μs ⚪ Unchanged
full_peg_complex 57.37 μs 57.93 μs 0.56 μs ⚪ Unchanged
full_peg_for_loop 6.26 μs 6.31 μs 0.05 μs ⚪ Unchanged
full_peg_nested_expansions 16.84 μs 17.05 μs 0.21 μs ⚪ Unchanged
full_peg_pipeline 4.18 μs 4.22 μs 0.04 μs ⚪ Unchanged
full_peg_simple 1.75 μs 1.75 μs -0.00 μs ⚪ Unchanged
function_call 2.19 μs 2.22 μs 0.03 μs ⚪ Unchanged
instantiate_shell 54.66 μs 53.66 μs -0.99 μs 🟢 -1.82%
instantiate_shell_with_init_scripts 27141.27 μs 27592.17 μs 450.91 μs ⚪ Unchanged
parse_peg_bash_completion 2092.90 μs 2135.59 μs 42.69 μs 🟠 +2.04%
parse_peg_complex 18.04 μs 19.35 μs 1.31 μs 🟠 +7.26%
parse_peg_for_loop 1.90 μs 1.91 μs 0.01 μs ⚪ Unchanged
parse_peg_pipeline 1.99 μs 1.93 μs -0.06 μs ⚪ Unchanged
parse_peg_simple 1.02 μs 1.04 μs 0.02 μs ⚪ Unchanged
run_echo_builtin_command 15.50 μs 15.84 μs 0.34 μs ⚪ Unchanged
tokenize_sample_script 3.90 μs 3.73 μs -0.17 μs 🟢 -4.38%

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
Overall Coverage 🟢 74.38% 🟢 74.38% ⚪ 0%

Minimum allowed coverage is 70%, this run produced 74.38%

Test Summary: bash-completion test suite

Outcome Count Percentage
✅ Pass 1558 73.87
❗️ Error 18 0.85
❌ Fail 179 8.49
⏩ Skip 339 16.07
❎ Expected Fail 13 0.62
✔️ Unexpected Pass 2 0.09
📊 Total 2109 100.00

@reubeno
Copy link
Copy Markdown
Owner

reubeno commented Feb 12, 2026

Thanks for the fix, @lu-zero!

Is this separate from #988, then? Could you please add a YAML-based test case that fails without this fix?

@lu-zero
Copy link
Copy Markdown
Contributor Author

lu-zero commented Feb 14, 2026

we can close this one and keep the other. (sorry for not noticing the reply till now)

@lu-zero lu-zero closed this Feb 14, 2026
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