Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

venv bug: Function “_old_fish_prompt” does not exist when activating venv in child process #93858

Closed
Assignees
vsajip
Labels
stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@thomasbbrunner

Description

@thomasbbrunner

Bug report

Looked for similar issues and could not find any.

Steps to reproduce bug:

  1. activate venv
  2. spawn child fish process (or start tmux session)
  3. activate same venv
source activate.fishfishsource activate.fish

Should output:
functions: Function “_old_fish_prompt” does not exist

Cause

I think I've identified the reason for the bug:

  1. The environment variables set inactivate.fish are exported to child processes (script usesset -gx to set the variables).
  2. However, the function_old_fish_prompt is not exported to child processes.

So, when we run fish from another fish session (such as in tmux), the variables set inactivate.fish are present in the child process, but the functions are not.

Fix

I've written a fix for this, which is to test if the_old_fish_prompt function exists before attempting to delete it. I can make a PR with this fix.

Also, the implementation fromvirtualenv does not suffer from this bug. They check if the function exists before deleting it.

Your environment

Ubuntu 22.04 amd64
Python 3.10.4
Python and venv packages installed from apt

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp