HBNetwork / python-decouple

Strict separation of config from code.
MIT License
2.83k stars 196 forks source link

Value ending and starting with quote marks " or ' #123

Closed Hatell closed 3 years ago

Hatell commented 3 years ago

If I have value starting and ending with quote ' or " in .env -file then quotes are removed from value.

I have a password 'hello' and I would like to pass it to .env -file like this

PASS="'hello'"

This isn't possible because decouple.py:132 line strip all ' or " characters from begin and end of the string v.

v = v.strip('\'"')

Instead of that I would do the removing of quotes like this

v = v[1:-1]
henriquebastos commented 3 years ago

This is a relevante issue. It seems related to #103.

If you can provide a PR improving the test code I would be glad to take a look.