[GRASS-dev] [GRASS GIS] #3508: grass start up: buggy to_text_string

GRASS GIS trac at osgeo.org
Fri Mar 2 07:09:53 PST 2018


#3508: grass start up: buggy to_text_string
-------------------------------+-------------------------
 Reporter:  martinl            |      Owner:  grass-dev@…
     Type:  defect             |     Status:  new
 Priority:  normal             |  Milestone:  7.2.3
Component:  Startup            |    Version:  svn-trunk
 Keywords:  wingrass, unicode  |        CPU:  Unspecified
 Platform:  Unspecified        |
-------------------------------+-------------------------
 GRASS fails even start on Windows when username contains non-ascii
 characters

 {{{
 Traceback (most recent call last):
   File "C:\Program Files\GRASS GIS 7.4.0\etc\grass74.py", line 2003, in
 <module>
     main()
   File "C:\Program Files\GRASS GIS 7.4.0\etc\grass74.py", line 1854, in
 main
     set_paths(grass_config_dir=grass_config_dir)
   File "C:\Program Files\GRASS GIS 7.4.0\etc\grass74.py", line 620, in
 set_paths
     os.environ['MANPATH'] = to_text_string(addons_man_path)
   File "C:\Program Files\GRASS GIS 7.4.0\Python27\lib\os.py", line 420, in
 __setitem__
     putenv(key, item)
 UnicodeEncodeError: 'ascii' codec can't encode character u'\u017e' in
 position 10: ordinal not in range(128)
 Press any key to continue . . .
 }}}

 When I change line source:grass/trunk/lib/init/grass.py#L620

 {{{
             os.environ['MANPATH'] = to_text_string(addons_man_path)
 }}}

 to

 {{{
             os.environ['MANPATH'] = addons_man_path
 }}}

 then GRASS starts and even MANPATH variable is set up correctly (including
 non-ascii characters). Function `to_text_string` is apparently buggy.
 Tested on Czech (cp1250) Windows 8.1.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/3508>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list