Postgres Connection String Python Replace Characters In List