Skip to content

AssertionError when attempting to locate dotenv file #499

Description

@HonakerM

Hello,

I updated to the latest python-dotenv version (1.0.1) this morning and am now starting to see the following Assertion Errors:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
<>
  File "/usr/local/lib/python3.11/site-packages/dotenv/main.py", line 305, in find_dotenv
    assert frame.f_back is not None
           ^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

The code that generated the above looks like the following:

if path := find_dotenv(raise_error_if_not_found=False):
  load_dotenv()

Please let me know if there are any other logs or data I can provide to help the debugging/investigation process

Activity

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

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