theskumar / theskumar/python-dotenv

python-dotenv cannot parse valid bash value with a single quote "escaped" inside single quotes

Offen
#544 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
8.9k
Forks
581
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
bash, python
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.