Opened 6 years ago

Closed 10 months ago

#2141 closed defect (fixed)

Linking or importing raster with non-ascii characters in filename fails in wxGUI with UnicodeEncodeError

Reported by: torsti Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: wxGUI Version: svn-trunk
Keywords: Cc:
CPU: x86-64 Platform: Linux

Description

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.

Change History (5)

comment:1 Changed 4 years ago by martinl

Milestone: 7.0.07.0.5

comment:2 Changed 3 years ago by martinl

Still an issue?

comment:3 Changed 3 years ago by neteler

Milestone: 7.0.57.0.6

comment:4 Changed 2 years ago by neteler

Milestone: 7.0.67.0.7

comment:5 Changed 10 months ago by martinl

Milestone: 7.0.77.6.2
Resolution: fixed
Status: newclosed

Unable to reproduce (7.6.1).

Note: See TracTickets for help on using tickets.