[GRASS-dev] [GRASS GIS] #2532: TypeError: environment can only contain string when launching script on Windows

GRASS GIS trac at osgeo.org
Tue Jan 6 12:33:34 PST 2015


#2532: TypeError: environment can only contain string when launching script on
Windows
-------------------------+--------------------------------------------------
 Reporter:  annakrat     |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  major        |   Milestone:  7.0.0                    
Component:  Default      |     Version:  svn-trunk                
 Keywords:  encoding     |    Platform:  MSWindows 8              
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------

Comment(by glynn):

 Replying to [comment:3 annakrat]:
 > I see what you were writing in #2525. So should we just catch an
 exception and say the user, sorry, don't use non ascii characters in the
 script path (and change your operating system)?

 It's not "non-ASCII" characters per se, it's characters which aren't
 representable in your system codepage (configurable on Windows 7 via
 Control Panel -> Region and Language -> Administrative -> Change system
 locale ...).

 For Western European languages, the system locale's encoding will be
 [http://en.wikipedia.org/wiki/Cp1252#Code_page_layout cp1252], which is
 basically [http://en.wikipedia.org/wiki/ISO-8859-1#Codepage_layout
 ISO-8859-1] but with most of the C1 control codes (\x80-\x9f) remapped to
 additional graphic characters.

 U+0165 is present in
 [http://en.wikipedia.org/wiki/Windows-1250#Code_page_layout cp1250]
 (Eastern European, similar to ISO-8859-2).

 It appears that Windows has a mechanism for approximating accented
 characters; if I create a directory whose name contains that character,
 the "dir" command (in a console using cp1252) shows the directory with the
 character replaced by "t", and I can "cd" into the directory.
 Unfortunately, this feature doesn't appear to be accessible via Python.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2532#comment:4>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list