[GRASS-dev] [GRASS GIS] #2210: unable to start GRASS GIS 7

GRASS GIS trac at osgeo.org
Sat Mar 15 01:41:55 PDT 2014


#2210: unable to start GRASS GIS 7
---------------------+------------------------------------------------------
  Reporter:  turek   |       Owner:  grass-dev@…              
      Type:  defect  |      Status:  reopened                 
  Priority:  normal  |   Milestone:  7.0.0                    
 Component:  Python  |     Version:  svn-trunk                
Resolution:          |    Keywords:                           
  Platform:  Linux   |         Cpu:  x86-64                   
---------------------+------------------------------------------------------

Comment(by marisn):

 I'm not able to reproduce the issue on my system no matter how hard I try.

 Still the issue seems to be twofold - there was not robust enough code to
 set language/locale in startup script. It is fixed and from r59215 it
 should work just fine* The second problem is that now some problems with
 other wxgui code have popped-up. I.e. getdefaultlocale shouldn't be used
 to get encoding.

 Can you, please, apply this patch and give me back output?
 {{{
 Index: lib/init/grass.py
 ===================================================================
 --- lib/init/grass.py   (revision 59254)
 +++ lib/init/grass.py   (working copy)
 @@ -784,7 +784,10 @@
          # Language override is disabled (system language specified)
          # As by default program runs with C locale, but users expect to
          # have their default locale, we'll just set default locale
 -        locale.setlocale(locale.LC_ALL, '')
 +        try:
 +            locale.setlocale(locale.LC_ALL, '')
 +        except:
 +            warning("Setting default locale failed. It indicates
 misconfigured system. Check systems locale settings.")
          if windows and os.getenv('LANG') is None:
              language, encoding = locale.getdefaultlocale()
              os.environ['LANG'] = language
 @@ -1296,6 +1299,14 @@
  # Subsequent functions are using _() calls and
  # thus must be called only after Language has been set.
  set_language()
 +for lc in ('LC_CTYPE', 'LC_MESSAGES', 'LC_TIME', 'LC_COLLATE',
 +          'LC_MONETARY', 'LC_PAPER', 'LC_NAME', 'LC_ADDRESS',
 +          'LC_TELEPHONE', 'LC_MEASUREMENT', 'LC_IDENTIFICATION',
 +          'LANG', 'LANGUAGE', 'LC_ALL'):
 +    if lc in os.environ:
 +        print "%s = ' %s '" % (lc, os.environ[lc])
 +    else:
 +        print "%s = unset" % lc

  # Create the temporary directory and session grassrc file
  create_tmp()
 }}}


 * one of most common misconceptions of all programmers.

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



More information about the grass-dev mailing list