Closed dss010101 closed 3 months ago
The DSN is a URL and so all parts must be explicitly quoted with urllib.parse.quote
came here via https://github.com/MagicStack/asyncpg/pull/1159 with the same problem, even if quoted some special characters are not allowed it seems
came here via #1159 with the same problem, even if quoted some special characters are not allowed it seems
Quoted does not mean surrounded by double quotes but rather percent encoded. DSN is a URL, so you must use urllib.parse.quote
to encode special characters properly. This is also prominently documented:
thanks @elprans, should've known that 😉
using urllib.parse.quote
still produces the same problem and #1159 is updated to reflect that
Oh, right, looks like plain quote()
isn't quoting enough, use urllib.parse.quote_plus()
. I'll amend the docs.
My connection string looks like this:
Im connecting as follows:
The error i am getting is complaining about my password (that is what its highlighting anyway)
My password has '!' and another non-ascii character in it in a few places - i wonder if that may be causing it or if its how i have created the connection string above? Alternatively, the stack trace seems to indicate it wants a port - but I'm using an Azure Postgres Flexible Server - im not sure there is a port available for that...(with psycopg driver, it wasnt necessary to specify a port.)
Any help would be apricated