[GRASS-dev] [GRASS GIS] #1972: v.in.ogr wrapper fails with UnicodeEncodeError

#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)
}}}

GRASS trunk r56142

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1972&gt;
GRASS GIS <http://grass.osgeo.org>

#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 |
-------------------------+--------------------------------------------------

Comment(by mlennert):

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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1972#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#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 |
-------------------------+--------------------------------------------------

Comment(by 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)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1972#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#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 |
-------------------------+--------------------------------------------------

Comment(by annakrat):

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.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1972#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#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 |
-------------------------+--------------------------------------------------

Comment(by marisn):

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.

Needs a backport to 7.0 branch?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1972#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1972: v.in.ogr wrapper fails with UnicodeEncodeError
--------------------------+-------------------------------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: fixed | Keywords:
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by annakrat):

  * status: new => closed
  * resolution: => fixed

Comment:

>
> Needs a backport to 7.0 branch?

Done in r61281. Closing the ticket.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1972#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>