theskumar / theskumar/python-dotenv
python-dotenv cannot parse valid bash value with a single quote "escaped" inside single quotes
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.9k
- Forks
- 581
- PR merge metrics
- No merged PRs in 30d
Description
Problem
This is a valid bash ENV excerpt which escapes a single quote inside value surrounded by singles quotes (see this SO comment)
❯ VAR='I'"'"'m a student'
❯ echo $VAR
I'm a student
However python dotenv cannot parse this value. Assume that .env file is created with VAR='I'"'"'m a student' line inside
❯ dotenv list
Python-dotenv could not parse statement starting at line 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by placing the shown VAR assignment in a .env file and running the mentioned dotenv list command. Start by tracing the dotenv parser used by that command and add or find parser tests for quoted values. Done means the line is accepted and the resulting value is I'm a student.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100