activate.fish leaves a literal ^/dev/null entry in PATH
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- fish, python
- 领域
- cli, testing-qa
调研方向
检查 ACTIVATE_FISH 模板和 nodeenv.py 中的第二条 fish 命令;两者都使用 ^/dev/null。然后阅读 tests/test_activate_shells.py,移除 FISH_CARET_REDIRECT 的 xfail 设置,并恢复 @activating_shell。完成标准是两个重定向都使用现代写法,并且完整的 PATH 断言在没有虚假条目的情况下通过。
由索引模型根据 Issue 内容生成。
描述
Summary
bin/activate.fish appends a bogus ^/dev/null element to PATH. Every
fish user of nodeenv gets it. The same one-line bug also defeats the stderr
suppression the line was written for.
Reproduction
$ nodeenv --prebuilt /tmp/ne
$ fish -c 'source /tmp/ne/bin/activate.fish; string join \n $PATH | tail -1'
^/dev/null
Observed in CI on ubuntu-latest as a fourth PATH entry resolving to
<cwd>/^/dev/null.
Cause
ACTIVATE_FISH ends its PATH line with a caret redirect:
# The node_modules/.bin path doesn't exists and it will print a warning, and
# that's why we redirect stderr to /dev/null :)
set -gx PATH "$NODE_VIRTUAL_ENV/lib/node_modules/.bin" "$NODE_VIRTUAL_ENV/__BIN_NAME__" $PATH ^/dev/null
fish 3.0 introduced the stderr-nocaret feature flag and ^ stopped being
a stderr redirect; it is now an ordinary character. So ^/dev/null is
parsed as one more argument to set and lands in PATH.
Two consequences, not one:
PATHgains an entry that does not exist.- The warning the redirect was meant to hide now reaches stderr, so the
comment above the line no longer describes what happens.
nodeenv.py uses the same ^/dev/null syntax once more, inside freeze:
set -g NPM_LIST (npm list installed active >/dev/null ^/dev/null | \
cut -d ' ' -f 1 | grep -v npm)
Both should be fixed together. The modern spelling is 2>/dev/null.
Test coverage
tests/test_activate_shells.py (added in #397) marks this
xfail(strict=True) as FISH_CARET_REDIRECT on test_activate_sets_env,
via the path_shell decorator. When the fix lands, drop the constant and the
decorator and put the test back on @activating_shell.
Worth noting how it surfaced: the test originally asserted only the first two
PATH entries, which hid this completely and let CI report green. Widening
it to compare the whole list caught the bug on the first run. A regression
anywhere past index 1 was previously invisible.
- 主要语言
- Python
- 星标
- 1.8k
- 派生
- 224
- 平均合并
- 10 小时 15 分钟
- 30 天内合并 PR
- 22
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ekalinin/nodeenv 的其他 Issue
-
docs
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
docs
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
ekalinin/nodeenv#416 · 3 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
PedestrianDynamics/pyFDS-Evac#343 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
theskumar/python-dotenv#708 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 2 天内回复
-
Docs Timedelta
难度 2/5 1-3 小时 新手友好度 72/100
pandas-dev/pandas#69919 ·
维护者通常 1 天内回复
-
API documentation
难度 2/5 1-3 小时 新手友好度 72/100
zephyrproject-rtos/west#1009 · 2 条评论 ·
维护者通常 3 天内回复