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

GRASS GIS trac at osgeo.org
Thu Jan 15 00:56:45 PST 2015


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

Comment(by glynn):

 Replying to [comment:8 annakrat]:

 > That comes from
 [http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/lmgr/frame.py#L906
 here], there are no details, it's ran without any arguments.

 I see.

 It's executing the script, which is executing g.parser, which is reading
 the option definitions from the script then calling G_parser(). As it's
 called without arguments, G_parser() should be generating a GUI dialog,
 but it's not even attempting to do that; it's falling through to the
 option-checking code.

 AFAICT, in order for that error message to occur, either argc would have
 to be at least 2 or isatty(0) would have to be false. But if argc >= 2,
 that would result in the value of argv[1] being used as the value for
 araster= (even if it's an empty string), which would prevent the "Required
 parameter <araster> not set" error.

 Which leaves isatty(0) being false. But that shouldn't have anything to do
 with whether the script filename contains non-ASCII characters. it might
 be something to do with wxGUI, or it might be Windows weirdness.

 Can you add the following to the script, before the call to
 grass.parser():
 {{{
 import os
 print os.isatty(0)
 }}}

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



More information about the grass-dev mailing list