Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support expanduser() for dotenv_path #525

Open
wgong opened this issue Jul 15, 2024 · 3 comments
Open

support expanduser() for dotenv_path #525

wgong opened this issue Jul 15, 2024 · 3 comments

Comments

@wgong
Copy link

wgong commented Jul 15, 2024

It would be great if one can place API_KEYs in one .env file outside github repositories,
currently dotenv_path argument does not support "~" as home_path.

Please consider improving this line at https://github.com/theskumar/python-dotenv/blob/main/src/dotenv/main.py#L45
as

self.dotenv_path: Optional[StrPath] = Path(dotenv_path).expanduser()

Thanks

@stuaxo
Copy link

stuaxo commented Jan 6, 2025

@wgong this would have a better chance of being merged as a PR

@wgong
Copy link
Author

wgong commented Jan 7, 2025

thanks for considering this enhancement

@theskumar
Copy link
Owner

@wgong I believe this is a safe change, can be supported. cc: @bbc2

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

No branches or pull requests

3 participants