Skip to content

Commit

Permalink
Avoid .encode('utf8') call too
Browse files Browse the repository at this point in the history
Was tested with python2, let's see if it fixes python3 too
  • Loading branch information
strk committed Jun 6, 2017
1 parent 50641f7 commit 35f7839
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/postgis/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, uri):

expandedConnInfo = self._connectionInfo()
try:
self.connection = psycopg2.connect(expandedConnInfo.encode('utf-8'))
self.connection = psycopg2.connect(expandedConnInfo)
except self.connection_error_types() as e:
err = unicode(e)
uri = self.uri()
Expand All @@ -79,7 +79,7 @@ def __init__(self, uri):

newExpandedConnInfo = uri.connectionInfo(True)
try:
self.connection = psycopg2.connect(newExpandedConnInfo.encode('utf-8'))
self.connection = psycopg2.connect(newExpandedConnInfo)
QgsCredentials.instance().put(conninfo, username, password)
except self.connection_error_types() as e:
if i == 2:
Expand Down

0 comments on commit 35f7839

Please sign in to comment.