~olly/yoyo#76: 
Error parsing password from yoyo.ini

This appears to be a variant of #74.

For the following database connection string:

postgresql://%(DATABASE_USERNAME)s:%(DATABASE_PASSWORD)s@%(DATABASE_HOST)s/%(DATABASE_NAME)s?%(DATABASE_OPTIONS)s

If I provide a password that includes symbols such as:

+&~#/

I receive the following error:

ValueError: invalid literal for int() with base 10: "pass+&~#/"

Sorry to keep bothering, and thank you for taking a look.

Status
REPORTED
Submitter
~jeredsutton_opstack
Assigned to
No-one
Submitted
3 years ago
Updated
1 year, 6 months ago
Labels
No labels applied.

~olly 3 years ago

I think you need to URL escape the password, eg:

DATABASE_PASSWORD="pass%2B%26~%23%2F"

~jeredsutton_opstack 3 years ago

I think you are correct, however that will be difficult to do with the way the environment variables are being populated.

The issue seems to stem from the code assuming the 'database' URL is properly urlencoded (a valid assumption). If that is the case, can I turn this into a feature request to support a 'username' and/or 'password' option in the config file with those options passing through a urllib.parse.quote?

~espo1026 1 year, 6 months ago

I am having a similar issue. I am pulling an auto-generated secret from AWS Secrets Manager that has a ? in it - causing the same error as this ticket pretty much. Is there a workaround other than using a password without the special character? I thought I would be able to pass each parsed value myself - i.e. username: password: host: database: etc.

Register here or Log in to comment, or comment via email.