Opened 11 years ago

Closed 10 years ago

#1972 closed defect (fixed)

v.in.ogr wrapper fails with UnicodeEncodeError

Reported by: marisn Owned by: grass-dev@…
Priority: major Milestone: 7.0.0
Component: wxGUI Version: svn-trunk
Keywords: Cc:
CPU: Unspecified Platform: Unspecified

Description

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

Change History (5)

comment:1 by mlennert, 11 years ago

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.

comment:2 by marisn, 10 years ago

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)

in reply to:  2 ; comment:3 by annakrat, 10 years ago

Replying to 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.

in reply to:  3 ; comment:4 by marisn, 10 years ago

Replying to 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?

in reply to:  4 comment:5 by annakrat, 10 years ago

Resolution: fixed
Status: newclosed

Needs a backport to 7.0 branch?

Done in r61281. Closing the ticket.

Note: See TracTickets for help on using tickets.