Closed edvn0 closed 2 years ago
Ah, yes, we could do more work to prune any whitespace when reading.
It would be preferable, in my opinion, to .strip()
instead.
I agree, however, I did not know if the API-keys contained whitespaces in the content (I've seen keys like key="API
API Keys do not contain whitespace. What I suspect is happening is the copy/paste from the website's snippet is including extra characters and giving you grief. We'll try to see if that can be addressed separately in a future UI update of the website.
I've pushed out #11 with some test cases that should help solve the issue.
My solution is rather aggressive, especially when we anticipate users to only have a config file with one line -- we now try to work extra hard to split and return the first non-empty value.
Closing due to preferred #11
Thanks for bringing this to our attention. We'll be releasing a new version shortly.
This commit fixes a bug which happened on my machine (MacOS Monterey 12.1) - when pasting the key from the webpage into the apikey-file in the default directory, the python API broke - complaining on both "\n" file endings and spaces.
Splitting on a space makes sense I believe, since the API-key are presumably never (reject this PR if so) space-inclusive.