Skip to content

test_fish_activate_shadowed_builtins runs a game instead of the fish shell #154419

Description

@serhiy-storchaka

Bug report

test_venv.test_fish_activate_shadowed_builtins fails on DragonFly BSD, because it runs a card game instead of the fish shell:

subprocess.CalledProcessError: Command ['/usr/games/fish', '--no-config',
'/tmp/tmplat2gfdt/test_shadowed_builtins.fish'] returned non-zero exit status 1.

/usr/games/fish is the "Go Fish" game (see fish(6)), and it is found by shutil.which('fish') because /usr/games precedes /usr/local/bin in PATH. Installing the fish shell does not help.

The game is also shipped on NetBSD and OpenBSD, where /usr/games is not in PATH by default, or is used only after the directory in which the fish shell is installed. So whether the test fails depends on the platform and on PATH:

game fish shell first in PATH
FreeBSD, Solaris no
NetBSD yes yes
OpenBSD yes yes
DragonFly BSD yes no

The game rejects every option with a non-zero exit status, so the fish shell can be recognized by running it. echo $FISH_VERSION also distinguishes it from other shells:

/usr/games/fish       FISH_VERSION=''
/usr/local/bin/fish   FISH_VERSION='3.7.1'

Searching PATH for a working fish shell makes the test pass on DragonFly BSD too, instead of skipping it. This is the only test using the fish shell, added for gh-140006, and the fish shell is not installed on any CI runner, so it is currently never run there, although activate.fish is shipped.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.16new features, bugs and security fixestestsTests in the Lib/test dirtopic-venvRelated to the venv moduletype-bugAn unexpected behavior, bug, or error

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions