Skip to content
Browse files
Processing - Fix unicode/str error in postgis_utils
  • Loading branch information
arnaud-morvan committed May 11, 2016
1 parent 0739750 commit 66b1416
Showing 1 changed file with 6 additions and 4 deletions.
@@ -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:

0 comments on commit 66b1416

Please sign in to comment.