Comment 3 for bug 406662

Revision history for this message
su_v (suv-lp) wrote :

I don't know if it's related but I can't run 'measure.py' from inside Inkscape at all.

Issue: python fails in 'locale.setlocale(locale.LC_ALL, '')'

Traceback (most recent call last):
  File "Contents/Resources/extensions/measure.py", line 34, in <module>
    locale.setlocale(locale.LC_ALL, '')
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/locale.py", line 476, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

I tried with 3 python verison (OS X python 2.5.1, MacPorts Python 2.5.1, 2.6.2). The strange thing is if I run the command outside of Inkscape (or the GLibc context?) like:

LeWitt:~ suv$ which python
/Volumes/blue/mp/bin/python
LeWitt:~ suv$ python --version
Python 2.6.2
LeWitt:~ suv$ python -c "import locale; print locale.setlocale(locale.LC_ALL, '')"
en_US.UTF-8
LeWitt:~ suv$

It is the only python extension which depends on locale settings. I tried with different LANG settings in the launcher script, but nothing so far lets python read the current locale setting when run in the context of Inkscape.

Inkscape 0.46+devel 22011, OS X 10.5.8

Python bug: <http://bugs.python.org/issue1699853%3E> "locale.getlocale() output fails as setlocale() input "