kennethreitz / records

SQL for Humans™
https://pypi.python.org/pypi/records/
ISC License
7.15k stars 574 forks source link

BUG with password use P@ssw0rd in db_url #225

Open DiLysenk opened 5 days ago

DiLysenk commented 5 days ago

If you use a password "P@ssw0rd", it will incorrectly identify the host after checks.

image

import records
connection_string = 'postgresql://pt_system:P@Ssssswwwerr@dsda@ps4.mp11.com:5432/triggers'
db = records.Database(connection_string, isolation_level=isolation_level)
billychou commented 4 days ago

You need to url-encode the password portion of the connect string:

from urllib.parse import quote_plus
password = quote_plus("P@ssw0rd")
connection_string = f'postgresql://pt_system:{password}@ps4.mp11.com:5432/triggers'