Skip to content

Commit

Permalink
Processing - Fix unicode/str error in postgis_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-morvan committed May 11, 2016
1 parent 0739750 commit 66b1416
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/plugins/processing/algs/qgis/postgis_utils.py
Expand Up @@ -93,12 +93,14 @@ def __init__(self, row):
class DbError(Exception):

def __init__(self, message, query=None):
# Save error. funny that the variables are in utf-8
self.message = unicode(message, 'utf-8')
self.query = (unicode(query, 'utf-8') if query is not None else None)
self.message = message
self.query = query

def __str__(self):
return 'MESSAGE: %s\nQUERY: %s' % (self.message, self.query)
return unicode(self).encode('utf-8')

def __unicode__(self):
return u'MESSAGE: %s\nQUERY: %s' % (self.message, self.query)


class TableField:
Expand Down

0 comments on commit 66b1416

Please sign in to comment.