Skip to content

Commit 8b8bc26

Browse files
committedNov 6, 2016
[processing] Fix connection to postgis
1 parent e426dbc commit 8b8bc26

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎python/plugins/processing/tools/postgis.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def uri_from_name(conn_name):
5959

6060
settings.endGroup()
6161

62+
if hasattr(authcfg, 'isNull') and authcfg.isNull():
63+
authcfg = ''
64+
6265
if service:
6366
uri.setConnection(service, database, username, password, sslmode, authcfg)
6467
else:
@@ -202,7 +205,7 @@ def __init__(self, host=None, port=None, dbname=None, user=None,
202205
for i in range(4):
203206
expandedConnInfo = self.uri.connectionInfo(True)
204207
try:
205-
self.con = psycopg2.connect(expandedConnInfo.encode('utf-8'))
208+
self.con = psycopg2.connect(expandedConnInfo)
206209
if err is not None:
207210
QgsCredentials.instance().put(conninfo,
208211
self.uri.username(),

0 commit comments

Comments
 (0)
Please sign in to comment.