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

Regression: Nox crashes with AttributeError: module 'sys' has no attribute 'real_prefix' when reusing virtualenvs #424

Closed
cjolowicz opened this issue May 22, 2021 · 1 comment · Fixed by #425
Labels

Comments

@cjolowicz
Copy link
Collaborator

Describe the bug
On the main branch, nox -r crashes with AttributeError: module 'sys' has no attribute 'real_prefix'. This appears to be a regression from #418.

How to reproduce
Install Nox into a virtualenv, and run its own test suite using -r.

$ git clone https://github.com/theacodes/nox
$ cd nox
$ virtualenv venv
$ . venv/bin/activate
$ pip install -e .
$ nox -rs tests -p 3.9
nox > Running session tests-3.9
nox > python3.9 -c import sys; print(sys.prefix)
nox > .../nox/.nox/tests-3-9/bin/python -c import sys; print(sys.real_prefix)
nox > Command .../nox/.nox/tests-3-9/bin/python -c import sys; print(sys.real_prefix) failed with exit code 1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'sys' has no attribute 'real_prefix'
nox > Session tests-3.9 failed.

Expected behavior
Nox reuses the virtual environment without crashing.

@cjolowicz
Copy link
Collaborator Author

[OT, will open a separate issue]

The following line from #418 does not work on Windows:

os.path.join(self.location, "bin", "python"),

This directory is named "Scripts" on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant