Cast env_dir to string before passing to load_dotenv as passing a PosixPath to load_dotenv raises an exception in 3.5.
This commit is contained in:
@ -80,14 +80,14 @@ def read(filename, module, install=False, quiet=False, verbose=False, default_en
|
|||||||
env_dir = Path(filename).parent or Path(module).parent
|
env_dir = Path(filename).parent or Path(module).parent
|
||||||
if default_env_file:
|
if default_env_file:
|
||||||
for f in default_env_file:
|
for f in default_env_file:
|
||||||
env_file_path = env_dir.joinpath(f)
|
env_file_path = str(env_dir.joinpath(f))
|
||||||
load_dotenv(env_file_path)
|
load_dotenv(env_file_path)
|
||||||
if default_env:
|
if default_env:
|
||||||
for e in default_env:
|
for e in default_env:
|
||||||
set_env_var(e)
|
set_env_var(e)
|
||||||
if env_file:
|
if env_file:
|
||||||
for f in env_file:
|
for f in env_file:
|
||||||
env_file_path = env_dir.joinpath(f)
|
env_file_path = str(env_dir.joinpath(f))
|
||||||
load_dotenv(env_file_path, override=True)
|
load_dotenv(env_file_path, override=True)
|
||||||
if env:
|
if env:
|
||||||
for e in env:
|
for e in env:
|
||||||
|
|||||||
Reference in New Issue
Block a user