Skip to content

Conversation

@kevinbackhouse
Copy link
Collaborator

Apparently load_dotenv() uses the location of the script by default, not the cwd.

Copilot AI review requested due to automatic review settings November 14, 2025 11:42
Copilot finished reviewing on behalf of kevinbackhouse November 14, 2025 11:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the .env file loading behavior to search in the current working directory instead of the script's location. The change addresses a common issue where load_dotenv() defaults to the script's directory rather than the current working directory.

Key Changes:

  • Added find_dotenv import from dotenv module
  • Modified load_dotenv() to use find_dotenv(usecwd=True) for cwd-based search

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@m-y-mo
Copy link
Contributor

m-y-mo commented Nov 14, 2025

There's one here too: https://github.com/GitHubSecurityLab/seclab-taskflow-agent/blob/main/src/seclab_taskflow_agent/agent.py#L21

@kevinbackhouse kevinbackhouse merged commit f1c14af into GitHubSecurityLab:main Nov 14, 2025
9 checks passed
@kevinbackhouse kevinbackhouse deleted the find_dotenv branch November 14, 2025 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants