by jepler · 3y ago · 0 comments
Here's a line of bash code that sets the variable X to a single-quote character:
X=''\'''
(lest you think that's an unduly obtuse way to do it, this is what `git rev-parse --sq-quote` does! If not 'best practice' it's surely at least 'practice that's gotta be supported'!)Here's what python-dotenv gets:
Python-dotenv could not parse statement starting at line 1
Similarly, when you use python-dotenv to set a key with the value containing only the single quote dotenv.set_key('.env', 'X', "'")
the file is not acceptable to bash: bash: .env: line 1: unexpected EOF while looking for matching `''