fix(nodeenv): replace leftover debug print with logger.debug - #391
Merged
Conversation
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
force-pushed
the
fix/remove-debug-print
branch
from
August 13, 2026 18:49
ff8892e to
d885f1d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #390
Problem
_get_last_node_version()contained a leftover debugprint(), added in cf0c993 (PR #363):It writes a dict to stdout on every version detection - a plain run,
--node=latestor--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 existinglogger.debugcalls in the file.Test
Added
test_get_last_node_version_writes_nothing_to_stdout, which fails on the current code with: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.