Skip to content
Permalink
Browse files
Fix exception in GDALTools.doRasterize.loadFields due to Python 3 con…
…version
  • Loading branch information
rouault committed Oct 6, 2016
1 parent 5b6e4b8 commit fffbf784b099307cc22d74cfd522209693aa1339
Showing with 6 additions and 2 deletions.
  1. +6 −2 python/plugins/GdalTools/tools/doRasterize.py
@@ -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.