Closed Alyetama closed 11 months ago
Thanks, that makes sense, and I can't see any reason interpolation would be needed in this file. I notice, though, that the docs on RawConfigParser
suggest doing it differently:
Consider using ConfigParser instead which checks types of the values to be stored internally. If you don’t want interpolation, you can use
ConfigParser(interpolation=None)
.
Do you think that makes sense here.
Note that you can also leave your password out of this file and store it with keyring instead, which may be more secure (for some types of threats, not all).
Thank you for the response. I agree with you. I have updated the file to replace RawConfigParseer
with ConfigParser(interpolation=None)
in alignment with the documentation's recommended practice.
I am aware now that you can use keyring, but would still like to fix this bug since it's one of the password storing methods mentioned in the documentation.
Thank you!
The current error occurs due to ConfigParser performing environment variable substitution, causing issues when the password contains the '%' symbol. To fix this, I replaced ConfigParser with RawConfigParser, which avoids environment variable substitution.
Changes: Updated the code where ConfigParser was used to use RawConfigParser instead. By using RawConfigParser, the password should not be subjected to any environment variable substitution, and the issue should be resolved.