Skip to content

Commit

Permalink
Merge pull request #3058 from arnaud-morvan/processing_postgis_errors
Browse files Browse the repository at this point in the history
Processing - Fix unicode/str error in postgis_utils
  • Loading branch information
m-kuhn committed May 11, 2016
2 parents ab7a07a + 66b1416 commit 0d165e5
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 0d165e5

Please sign in to comment.