Skip to content

Allow magika 1.x — magika 0.6.x loads .env into os.environ at import #2719

Closed

Description

markitdown pins magika~=0.6.1 (packages/markitdown/pyproject.toml). Every magika 0.6.x runs dotenv.load_dotenv(dotenv.find_dotenv()) in magika/__init__.py at import time. find_dotenv() walks up from magika's own site-packages directory, so import markitdown silently loads the first .env it finds above the virtualenv into os.environ.

For us this meant variables from an unrelated .env leaking into a running server process. A setting the operator removed on purpose can also come back this way.

magika removed the dotenv dependency in 1.0.2 (google/magika#1283, google/magika#1285). With the current pin, markitdown users cannot get that fix.

Could the pin be relaxed to magika>=0.6.1,<2? Happy to open a PR if that is welcome.

Workaround until then: set PYTHON_DOTENV_DISABLED=1 before importing markitdown.

Activity

  1. afourney commented on Oct 21, 2026

    @afourney
    Member

    Thanks for the report and the suggested dependency range! We’ve merged #2722, which allows Magika 1.x. Closing this as resolved by that PR.

  2. added 2 commits that reference this issue on Oct 25, 2026
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions