From: Daniele Varrazzo Date: Mon, 2 Aug 2021 09:34:01 +0000 (+0200) Subject: Fix returning connection params in get_parameters() with empty default X-Git-Tag: 3.0.dev2~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f28e17c2fbd3a9208bc7c8aa860ce6f9a4d97ed9;p=thirdparty%2Fpsycopg.git Fix returning connection params in get_parameters() with empty default "options" and "tty" were returned even if they were set to their default. --- diff --git a/psycopg/psycopg/conninfo.py b/psycopg/psycopg/conninfo.py index 3d665c94b..9dfff1339 100644 --- a/psycopg/psycopg/conninfo.py +++ b/psycopg/psycopg/conninfo.py @@ -170,7 +170,7 @@ class ConnectionInfo: defaults = { i.keyword: i.compiled for i in pq.Conninfo.get_defaults() - if i.compiled + if i.compiled is not None } # Not returned by the libq. Bug? Bet we're using SSH. defaults.setdefault(b"channel_binding", b"prefer")