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

Appearance settings

venv/scripts/common/activate should use uname instead of $OSTYPE to detect Cygwin and MSYS #112507

Copy link
Copy link
@J-M0

Description

@J-M0
Issue body actions

Bug report

Bug description:

The venv activate script uses the $OSTYPE variable to determine if it's running on Cygwin or MSYS.

# on Windows, a path can contain colons and backslashes and has to be converted:
if [ "${OSTYPE:-}" = "cygwin" ] || [ "${OSTYPE:-}" = "msys" ] ; then
# transform D:\path\to\venv to /d/path/to/venv on MSYS
# and to /cygdrive/d/path/to/venv on Cygwin
export VIRTUAL_ENV=$(cygpath "__VENV_DIR__")
else
# use the path as-is
export VIRTUAL_ENV="__VENV_DIR__"
fi

$OSTYPE is not defined by POSIX. It's provided by bash and zsh, but may not be present in other shells like dash. The uname command is always available in any shell and should be used instead.

CPython versions tested on:

3.12

Operating systems tested on:

Windows

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-venvRelated to the venv moduleRelated to the venv moduletype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.