HBNetwork / python-decouple

Strict separation of config from code.
MIT License
2.79k stars 192 forks source link

fix quote stripping #166

Open almdudler777 opened 11 months ago

almdudler777 commented 11 months ago

Hi,

When running from .env file quotes will be correctly stripped in the current version.

But when that same .env file is loaded through a docker-compose.yml it will internally be loaded through os.environ and not be stripped of quotes.

This commit fixes and synchronizes this behaviour.

almdudler777 commented 11 months ago

On second thought, it might be better to apply the stripping only to values casted to non-string types.

Reason: I'm unsure about what will happen to something like PATH="/some/path/with whitespace" myprogram.py In an .env file quotes should be optional as the equal (=) sign and the line-break are the separators. On the cmd-line paths with whitespace in them need to be surrounded by quotes as the whitespace is a reserved character.

henriquebastos commented 9 months ago

Can you provide regression tests to expose the problem and the actual fix?