theskumar / theskumar/python-dotenv

Doesn't accept any pathnames nor show errors on python 3.9.2 / raspberry pi

Open
#427 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.9k
Forks
581
PR merge metrics
No merged PRs in 30d

Description

Either running from a script, or from the command line, it doesn't accept any pathnames as valid arguments

toni@rpi:~/temp $ pwd
/home/toni/temp
toni@rpi:~/temp $ dotenv list
ENV1=value1
ENV2=value2
toni@rpi:~/temp $ dotenv -f /home/toni/temp list
Usage: dotenv list [OPTIONS]
Try 'dotenv list --help' for help.

Error: Invalid value: Path "/home/toni/temp" does not exist.
toni@rpi:~/temp $ dotenv -f . list
Usage: dotenv list [OPTIONS]
Try 'dotenv list --help' for help.

Error: Invalid value: Path "." does not exist.
toni@rpi:~/temp $ dotenv -f / list
Usage: dotenv list [OPTIONS]
Try 'dotenv list --help' for help.

Error: Invalid value: Path "/" does not exist.
toni@rpi:~/temp $ 

In a script, load_dotenv() works if I'm in the correct directory. However, load_dotenv(dotenv_path="/home/toni/temp", verbose=True) or any other directory falls silently without populating the relevant environment variables.

The environment:

toni@rpi:~/temp $ python -V
Python 3.9.2
toni@rpi:~/temp $ cat /etc/issue
Debian GNU/Linux 11 \n \l

toni@rpi:~/temp $ uname -a
Linux rpi 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux
toni@rpi:~/temp $

Happy to provide further debugging information as needed. Your contribution guidelines don't provide any guidance on what's useful. Perhaps that could be something to add, too, to make issue submissions easier to look at.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported dotenv -f commands and the load_dotenv(dotenv_path=..., verbose=True) call on the documented Python and Debian environment. Trace the CLI path handling and the load_dotenv entry point; done means valid pathnames are accepted, failures are reported appropriately, and variables load from the specified path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.