[GRASS-dev] [GRASS GIS] #2141: Linking or importing raster with non-ascii characters in filename fails in wxGUI with UnicodeEncodeError

GRASS GIS trac at osgeo.org
Sun Dec 8 02:01:46 PST 2013


#2141: Linking or importing raster with non-ascii characters in filename fails in
wxGUI with UnicodeEncodeError
--------------------+-------------------------------------------------------
 Reporter:  torsti  |       Owner:  grass-dev@…              
     Type:  defect  |      Status:  new                      
 Priority:  normal  |   Milestone:  7.0.0                    
Component:  wxGUI   |     Version:  svn-trunk                
 Keywords:          |    Platform:  Linux                    
      Cpu:  x86-64  |  
--------------------+-------------------------------------------------------
 GRASS SVN Revision: 58403

 When attempting to import or link a raster with a non-ascii basename the
 wxGUI dialog, after selecting the file, does not provide a layer for
 selection.

 Traceback from Command console output from r.external, but same happens
 with r.in.gdal:

 {{{
 Traceback (most recent call last):
   File "/usr/lib/python2.7/dist-
 packages/wx-2.8-gtk2-unicode/wx/lib/filebrowsebutton.py",
 line 140, in OnChanged

 self.changeCallback(evt)
   File "/usr/local/grass-7.0.svn/etc/gui/wxpython/gui_core/g
 select.py", line 1813, in OnUpdate

 self._reloadLayers()
   File "/usr/local/grass-7.0.svn/etc/gui/wxpython/gui_core/g
 select.py", line 1849, in _reloadLayers

 grassName = GetValidLayerName(baseName.split('.', -1)[0])
   File
 "/usr/local/grass-7.0.svn/etc/gui/wxpython/core/utils.py",
 line 201, in GetValidLayerName

 retName = str(name).strip()
 UnicodeEncodeError
 :
 'ascii' codec can't encode character u'\xf6' in position 18:
 ordinal not in range(128)
 }}}

 The filename in question:
 `/home/torsti/lähdeaineistot/Kansalliskirjasto/pitäjänkartta/VVJ/670-253 -
 1945 - Röykkä - 1.tif`. The $GISDBASE path does not contain non-ascii
 characters and importing/linking files where any path component except the
 filename/basename contains non-ascii characters does work, e.g. importing
 the same file with `Roykka` substituted for `Röykkä` is ok.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2141>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list