#1972: v.in.ogr wrapper fails with UnicodeEncodeError
-------------------------+--------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Keywords: | Platform: Unspecified
Cpu: Unspecified |
-------------------------+--------------------------------------------------
Steps to reproduce: use v.in.ogr new wrapper to import a shapefile
selected with "browse" button.
{{{
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-
packages/wx-2.9.4-gtk2/wx/lib/filebrowsebutton.py", line
140, in OnChanged
self.changeCallback(evt)
File "/home/maris/soft/grass_trunk/dist.x86_64-unknown-
linux-gnu/etc/gui/wxpython/gui_core/gselect.py", line 1686,
in OnSetDsn
self._reloadLayers()
File "/home/maris/soft/grass_trunk/dist.x86_64-unknown-
linux-gnu/etc/gui/wxpython/gui_core/gselect.py", line 1743,
in _reloadLayers
self.parent.list.LoadData(data)
File "/home/maris/soft/grass_trunk/dist.x86_64-unknown-
linux-gnu/etc/gui/wxpython/gui_core/dialogs.py", line 2038,
in LoadData
self.SetStringItem(index, i, "%s" % str(item[i]))
UnicodeEncodeError
:
'ascii' codec can't encode character u'\u0101' in position
1: ordinal not in range(128)
}}}
Could you give details about the shapefile you are trying to import and
the path to that file ? There used to be an issue with importing files
with special characters in the path or file names. I do not have this
issue with grass7 anymore. In grass64release it spits out similar error
messages as the one above, but it still imports.
I still see the same error with any file in my system. Tested with:
{{{
/home/maris/geodata/gadm_v1_lev0_shp/gadm1_lev0.shp
/home/maris/Lejupielādes/estonia.shapefiles/Esti_towers.shp
}}}
GRASS SVN Revision: 58952M
GNU/Linux with UTF-8 locale (lv_LV.UTF-8)
Replying to [comment:2 marisn]:
> I still see the same error with any file in my system. Tested with:
> {{{
> /home/maris/geodata/gadm_v1_lev0_shp/gadm1_lev0.shp
> /home/maris/Lejupielādes/estonia.shapefiles/Esti_towers.shp
> }}}
>
> GRASS SVN Revision: 58952M
> GNU/Linux with UTF-8 locale (lv_LV.UTF-8)
The problem was with translatable string "Yes" or "No" which is inserted
into the list to describe if projection is matching. I removed the str
function in r61271. Needs testing also for English locale.
Replying to [comment:3 annakrat]:
> The problem was with translatable string "Yes" or "No" which is inserted
into the list to describe if projection is matching. I removed the str
function in r61271. Needs testing also for English locale.
Tested on my lv_LV.UTF-8 Linux system with current trunk - works fine.
Thank you, Anna.