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

fix quote stripping

Open almdudler777 opened this issue 1 year ago • 2 comments

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 avatar Oct 18 '23 20:10 almdudler777

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.

almdudler777 avatar Oct 19 '23 17:10 almdudler777

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

henriquebastos avatar Jan 01 '24 17:01 henriquebastos