Skip to content

fix(nodeenv): replace leftover debug print with logger.debug - #391

Merged
ekalinin merged 1 commit into
masterfrom
fix/remove-debug-print
Aug 13, 2026
Merged

fix(nodeenv): replace leftover debug print with logger.debug#391
ekalinin merged 1 commit into
masterfrom
fix/remove-debug-print

Conversation

@ekalinin

Copy link
Copy Markdown
Owner

Fixes #390

Problem

_get_last_node_version() contained a leftover debug print(), added in cf0c993 (PR #363):

print({"x86": is_x86_64_musl(), "risc": is_riscv64(), "lts": lts})

It writes a dict to stdout on every version detection - a plain run, --node=latest or --node=lts - so it fires on the most common code path. This breaks output formatting for tools that wrap nodeenv (reported with the Python distribution of pyright).

The line is present in the released 1.10.0.

Fix

Replaced with logger.debug(). The information itself is useful when debugging which host platform drives the version filter, so it is kept but routed through the logger - visible under -v, silent otherwise. Message style follows the existing logger.debug calls in the file.

Test

Added test_get_last_node_version_writes_nothing_to_stdout, which fails on the current code with:

assert "{'x86': Fals...ts': False}\n" == ''

It guards against any future stdout writes from this function, not just this particular print.

pytest: 80 passed. flake8 --extend-ignore=E127 nodeenv.py tests setup.py: clean.

The debug print in _get_last_node_version() leaked a dict to stdout on
every version detection (default run, --node=latest, --node=lts), which
breaks output formatting for tools wrapping nodeenv. fixes #390
@ekalinin
ekalinin force-pushed the fix/remove-debug-print branch from ff8892e to d885f1d Compare August 13, 2026 18:49
@ekalinin
ekalinin merged commit 41c1841 into master Aug 13, 2026
38 checks passed
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.

spurious print?

1 participant