python-dotenv icon indicating copy to clipboard operation
python-dotenv copied to clipboard

support expanduser() for dotenv_path

Open wgong opened this issue 1 year ago • 3 comments

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

wgong avatar Jul 15 '24 22:07 wgong

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

stuaxo avatar Jan 06 '25 20:01 stuaxo

thanks for considering this enhancement

wgong avatar Jan 07 '25 01:01 wgong

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

theskumar avatar Jan 07 '25 07:01 theskumar