-
-
Notifications
You must be signed in to change notification settings - Fork 171
Closed
Labels
Description
Thank you for maintaining nox!
Current Behavior
The session.env dictionary contains the following variables set to None:
PIP_REQUIRE_VIRTUALENVPIP_RESPECT_VIRTUALENVUV_SYSTEM_PYTHON__PYVENV_LAUNCHER__CONDA_PREFIX
Additionally, it only contains two string values:
VIRTUAL_ENVNOX_CURRENT_SESSION
It does not contain eg. PATH, which is #928. But since my symptoms are different, I opened a different issue.
As a result, when I pass env=session.env in a subprocess call, I get the following exception:
env_list.append(k + b'=' + os.fsencode(v))
~~~~~~~~~~~^^^
File "<frozen os>", line 849, in fsencode
TypeError: expected str, bytes or os.PathLike object, not NoneTypeExpected Behavior
I would expect session.env to 1/ actually contain the environment 2/ not contain any None values.
Steps To Reproduce
With this noxfile:
import nox
@nox.session()
def test(session):
for k, v in session.env.items():
print(k, v)$ nox -s test
__PYVENV_LAUNCHER__ None
UV_SYSTEM_PYTHON None
PIP_REQUIRE_VIRTUALENV None
PIP_RESPECT_VIRTUALENV None
VIRTUAL_ENV /private/tmp/.nox/test
CONDA_PREFIX None
NOX_CURRENT_SESSION test
Environment
- OS: macOS 15.3
- Python: 3.13.1
- Nox: 2025.02.09Anything else?
I have bisected this, and the culprit appears to be #874.