Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in venv/scripts/common/activate when $OSTYPE is not set #112252

Closed
jamesturk opened this issue Nov 19, 2023 · 0 comments
Closed

Error in venv/scripts/common/activate when $OSTYPE is not set #112252

jamesturk opened this issue Nov 19, 2023 · 0 comments
Labels
3.12 bugs and security fixes 3.13 bugs and security fixes topic-venv Related to the venv module type-bug An unexpected behavior, bug, or error

Comments

@jamesturk
Copy link
Contributor

jamesturk commented Nov 19, 2023

Bug report

Bug description:

When trying to use . .venv/bin/activate to activate a virtualenv from within a Justfile the script exits with an error "sh: 42: .venv/bin/activate: OSTYPE: parameter not set".

Failing Test on 3.12.0: https://github.com/jamesturk/venv-just-experiment/actions/runs/6917021149/job/18817722528
Successful on 3.11.6: https://github.com/jamesturk/venv-just-experiment/actions/runs/6917021149/job/18817722369

This only started happening on Python 3.12, and I confirmed is still happening on the main branch.

It seems a change to Lib/venv/scripts/common/activate is at issue here. I'll submit a matching PR.

Due to the use of the variable without a default (unlike other variables in this script), running activate inside of a script with set -u/set -o nounset will fail.

CPython versions tested on:

3.12, CPython main branch

Operating systems tested on:

Linux, macOS

Linked PRs

@jamesturk jamesturk added the type-bug An unexpected behavior, bug, or error label Nov 19, 2023
@Eclips4 Eclips4 added topic-venv Related to the venv module 3.12 bugs and security fixes 3.13 bugs and security fixes labels Nov 19, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 21, 2023
…H-112253)

(cherry picked from commit e1540ae)

Co-authored-by: James Turk <dev@jamesturk.net>
fornwall added a commit to fornwall/advent-of-code that referenced this issue Dec 11, 2023
serhiy-storchaka pushed a commit that referenced this issue Dec 25, 2023
) (GH-112297)

(cherry picked from commit e1540ae)

Co-authored-by: James Turk <dev@jamesturk.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes 3.13 bugs and security fixes topic-venv Related to the venv module type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants