Skip to content

2021.11.9 raises TypeError when running with PIPENV_DONT_LOAD_ENV set #4851

@felixhammerl

Description

@felixhammerl

Issue description

2021.11.9 raises TypeError: 'NoneType' object is not iterable when running with the environment variable PIPENV_DONT_LOAD_ENV set. This is a regression from 2021.11.5, where this error is not present.

Expected result

Script gets executed

Actual result

> STAGE=dev PIPENV_DONT_LOAD_ENV=1 pipenv run test-functional
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/cli/command.py", line 413, in run
    do_run(
  File "/usr/local/lib/python3.8/site-packages/pipenv/core.py", line 2462, in do_run
    env.update(load_dot_env(project, as_dict=True))
TypeError: 'NoneType' object is not iterable

Steps to replicate

> pip install pipenv==2021.11.5
> STAGE=dev PIPENV_DONT_LOAD_ENV=1 pipenv run test-functional

This works.

> pip install --upgrade pipenv
> STAGE=dev PIPENV_DONT_LOAD_ENV=1 pipenv run test-functional

This installs version 2021.11.9 and fails.

Relevant portion of the Pipfile:

[scripts]
test-functional = "pytest test/functional"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions