Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

activate.fish leaves a literal ^/dev/null entry in PATH

クローズ 初心者向け
#400 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

関連するプルリクエストがすでにマージされています。

  • #427 @r3wretrhy による — マージ済み

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
fish, python
領域
cli, testing-qa

調査の方向性

ACTIVATE_FISH テンプレートと nodeenv.py 内の 2 つ目の fish コマンドを調べます。どちらも ^/dev/null を使用しています。次に tests/test_activate_shells.py を読み、FISH_CARET_REDIRECT の xfail 設定を削除して、@activating_shell を復元します。完了の条件は、両方のリダイレクトが現代的な表記を使用し、完全な PATH アサーションが偽のエントリなしでパスすることです。

索引モデルが issue の本文から書いたものです。

説明

bug

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:

  1. PATH gains an entry that does not exist.
  2. 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
フォーク
225
平均マージ
17時間 18分
マージ済み PR(30日)
26

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ekalinin/nodeenv のほかの issue

ekalinin/nodeenv の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。