python-dotenv icon indicating copy to clipboard operation
python-dotenv copied to clipboard

cannot parse with semicolons

Open eangius opened this issue 5 years ago • 1 comments

Semicolons ; are valid syntax in .env files but they do not parse when loading with this library. Rather than requiring semicolons to be removed in the config file, would like this library to handle them when present. Below is an example use-case.


production.env

DB_HOST='localhost'; DB_PORT=1234;
DB_NAME='mydatabase';

source code

from dotenv import dotenv_values
cfg = dotenv_values("/path/to/production.env")

error

Python-dotenv could not parse statement starting at line 1
Python-dotenv could not parse statement starting at line 2

eangius avatar Jul 08 '21 14:07 eangius

@eangius Thanks for reporting, but unless we have more similar request and community in support this logic, I'll have to put this request as out of scope for this library.

theskumar avatar Jun 17 '23 08:06 theskumar