[GRASS-dev] [GRASS GIS] #1776: Python error by startup

#1776: Python error by startup
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------
Hi, I just compiled / build GRASS 7.0 from source and got the following
error message when starting up GRASS:

Popup 'Python error':
---------------------
Cannot set locale to ".

Messages on command line:
--------------------------
Failed to set LC_ALL to None.UTF-8

(process:14771): Gdk-WARNING **: locale not supported by C library

(process:14771): Gtk-WARNING **: Locale not supported by C library.
         Using the fallback 'C' locale.

These messages appear twice; directly at start up and then again when the
Layer manager and Display open.

My system information:
-----------
GRASS version: 7.0.svn
GRASS SVN Revision: 53615
GIS Library Revision: 52468 (2012-07-27)
GDAL/OGR: 1.9.2
PROJ4: Rel. 4.7.1, 23 September 2009
Python: 2.7.3
wxPython: 2.8.12.1
Platform: Linux-3.5.0-17-generic-x86_64-with-Ubuntu-12.10-quantal

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1776&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by lucadelu):

Could you return the result of unix command
== locale ==

Thanks
Luca

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1776#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=“en_US.UTF-8”
LC_TIME=“en_US.UTF-8”
LC_COLLATE=en_US.UTF-8
LC_MONETARY=“en_US.UTF-8”
LC_MESSAGES=en_US.UTF-8
LC_PAPER=“en_US.UTF-8”
LC_NAME=“en_US.UTF-8”
LC_ADDRESS=“en_US.UTF-8”
LC_TELEPHONE=“en_US.UTF-8”
LC_MEASUREMENT=“en_US.UTF-8”
LC_IDENTIFICATION=“en_US.UTF-8”
LC_ALL=

···

On 10/31/2012 11:41 AM, GRASS GIS wrote:

#1776: Python error by startup
------------------------+---------------------------------------------------
 Reporter:  pvanbosgeo  |       Owner:  grass-dev@…              
     Type:  defect      |      Status:  new                      
 Priority:  normal      |   Milestone:  6.4.3                    
Component:  Default     |     Version:  svn-trunk                
 Keywords:              |    Platform:  Linux                    
      Cpu:  x86-64      |  
------------------------+---------------------------------------------------

Comment(by lucadelu):

 Could you return the result of unix command
 == locale ==

 Thanks
 Luca

#1776: Python error by startup
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by pvanbosgeo):

LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE=en_US.UTF-8
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES=en_US.UTF-8
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1776#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by pvanbosgeo):

This problem started with the latest revision. However, I installed this
latest revision after upgrading to Ubuntu 12.10, so perhaps that has
broken something concerning the locale?

I see the Milestone is set to 6.4.3. Just to make sure, these problems are
with GRASS 7.0, not with GRASS 6.4

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1776#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by pvanbosgeo):

When starting R from within GRASS, I am getting the following lines, which
do not show when started R normally (not from within GRASS) from the
command line:

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C"
2: Setting LC_COLLATE failed, using "C"
3: Setting LC_TIME failed, using "C"
4: Setting LC_MESSAGES failed, using "C"
5: Setting LC_PAPER failed, using "C"
6: Setting LC_PAPER failed, using "C"
7: Setting LC_MEASUREMENT failed, using "C"

I am guessing this has the same underlying problem?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1776#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by martinl):

Replying to [ticket:1776 pvanbosgeo]:

{{{
> Popup 'Python error':
> ---------------------
> Cannot set locale to ".
}}}

this error should be avoided in r53620. Can you try it out, please?

> Messages on command line:
> --------------------------
> Failed to set LC_ALL to None.UTF-8

Strange, what says

{{{
  env | grep LANG
}}}

and

{{{
locale -a
}}}

?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1776#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by martinl):

Replying to [comment:2 pvanbosgeo]:

{{{
> LANG=en_US.UTF-8
> LANGUAGE=en_US:en
}}}

do you have this locale installed? Check `locale -a`...

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1776#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
-------------------------------+--------------------------------------------
Reporter: pvanbosgeo | Owner: martinl
     Type: defect | Status: assigned
Priority: normal | Milestone: 6.4.3
Component: Default | Version: svn-trunk
Keywords: language settings | Platform: Linux
      Cpu: x86-64 |
-------------------------------+--------------------------------------------
Changes (by martinl):

* cc: grass-dev@… (added)
  * keywords: => language settings
  * status: new => assigned
  * owner: grass-dev@… => martinl

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1776#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
-------------------------------+--------------------------------------------
Reporter: pvanbosgeo | Owner: martinl
     Type: defect | Status: assigned
Priority: normal | Milestone: 6.4.3
Component: Startup | Version: svn-trunk
Keywords: language settings | Platform: Linux
      Cpu: x86-64 |
-------------------------------+--------------------------------------------
Changes (by martinl):

  * component: Default => Startup

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1776#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
-------------------------------+--------------------------------------------
Reporter: pvanbosgeo | Owner: martinl
     Type: defect | Status: assigned
Priority: normal | Milestone: 6.4.3
Component: Startup | Version: svn-trunk
Keywords: language settings | Platform: Linux
      Cpu: x86-64 |
-------------------------------+--------------------------------------------

Comment(by pvanbosgeo):

env | grep LANG:

LANG=en_US.UTF-8
LANGUAGE=en_US:en

locale -a

C
C.UTF-8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
POSIX

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1776#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
-------------------------------+--------------------------------------------
Reporter: pvanbosgeo | Owner: martinl
     Type: defect | Status: assigned
Priority: normal | Milestone: 6.4.3
Component: Startup | Version: svn-trunk
Keywords: language settings | Platform: Linux
      Cpu: x86-64 |
-------------------------------+--------------------------------------------

Comment(by martinl):

Replying to [comment:9 pvanbosgeo]:

{{{
> locale -a
...
> en_US.utf8
...
}}}

your currently used locale seems to be available. Hm, strange.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1776#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
-------------------------------+--------------------------------------------
Reporter: pvanbosgeo | Owner: martinl
     Type: defect | Status: assigned
Priority: normal | Milestone: 6.4.3
Component: Startup | Version: svn-trunk
Keywords: language settings | Platform: Linux
      Cpu: x86-64 |
-------------------------------+--------------------------------------------

Comment(by pvanbosgeo):

just tried r53623 and only one error message on the command line (Failed
to set LC_ALL to None.UTF-8 (unsupported locale setting)). No pop-up
window with error message anymore and no error messages when starting R
from within GRASS.

Paulo

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1776#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
-------------------------------+--------------------------------------------
Reporter: pvanbosgeo | Owner: martinl
     Type: defect | Status: assigned
Priority: normal | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Keywords: language settings | Platform: Linux
      Cpu: x86-64 |
-------------------------------+--------------------------------------------
Changes (by hamish):

  * milestone: 6.4.3 => 7.0.0

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1776#comment:12&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
----------------------------------------------+-----------------------------
Reporter: pvanbosgeo | Owner: martinl
     Type: defect | Status: assigned
Priority: normal | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Keywords: language settings, locales, i18n | Platform: Linux
      Cpu: x86-64 |
----------------------------------------------+-----------------------------
Changes (by wenzeslaus):

  * keywords: language settings => language settings, locales, i18n

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1776#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
----------------------------------------------+-----------------------------
Reporter: pvanbosgeo | Owner: martinl
     Type: defect | Status: assigned
Priority: normal | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Keywords: language settings, locales, i18n | Platform: Linux
      Cpu: x86-64 |
----------------------------------------------+-----------------------------

Comment(by marisn):

Paulo, could you, please, try GRASS 7 after r59176 ? I changed a bit
language overriding code in startup script to avoid problems like you had
and still be able to keep language override.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1776#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

Hi Marisn,

Yes, there is no error message anymore.. thanks!

Should I mark this ticket as fixed, or will you do that?

Paulo

On Mon 03 Mar 2014 10:05:53 PM CET, GRASS GIS wrote:

#1776: Python error by startup
----------------------------------------------+-----------------------------
  Reporter: pvanbosgeo | Owner: martinl
      Type: defect | Status: assigned
  Priority: normal | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
  Keywords: language settings, locales, i18n | Platform: Linux
       Cpu: x86-64 |
----------------------------------------------+-----------------------------

Comment(by marisn):

  Paulo, could you, please, try GRASS 7 after r59176 ? I changed a bit
  language overriding code in startup script to avoid problems like you had
  and still be able to keep language override.

#1776: Python error by startup
----------------------------------------------+-----------------------------
Reporter: pvanbosgeo | Owner: martinl
     Type: defect | Status: assigned
Priority: normal | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Keywords: language settings, locales, i18n | Platform: Linux
      Cpu: x86-64 |
----------------------------------------------+-----------------------------

Comment(by pvanbosgeo):

Hi Marisn,

Yes, there is no error message anymore.. thanks!

Should I mark this ticket as fixed, or will you do that?

Paulo

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1776#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>

#1776: Python error by startup
-------------------------+--------------------------------------------------
  Reporter: pvanbosgeo | Owner: martinl
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Resolution: fixed | Keywords: language settings, locales, i18n
  Platform: Linux | Cpu: x86-64
-------------------------+--------------------------------------------------
Changes (by neteler):

  * status: assigned => closed
  * resolution: => fixed

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1776#comment:16&gt;
GRASS GIS <http://grass.osgeo.org>