Skip to content

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

@YuryHrytsuk

Description

@YuryHrytsuk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions