Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix exception in GDALTools.doRasterize.loadFields due to Python 3 con…
…version
  • Loading branch information
rouault committed Oct 6, 2016
1 parent 5b6e4b8 commit fffbf78
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/plugins/GdalTools/tools/doRasterize.py
Expand Up @@ -153,6 +153,10 @@ def loadFields(self, vectorFile):
self.inSelector.setLayer(None)
return

ncodec = QTextCodec.codecForName(self.lastEncoding)
# GDAL Python3 bindings return fields as str and not bytes
# so no recoding is needed. But this assumes that the underlying
# OGR driver always return a Unicode string. hum...
#ncodec = QTextCodec.codecForName(self.lastEncoding)
for name in names:
self.attributeComboBox.addItem(ncodec.toUnicode(name))
self.attributeComboBox.addItem(name)
#self.attributeComboBox.addItem(ncodec.toUnicode(name))

0 comments on commit fffbf78

Please sign in to comment.