Search

Friends

Atomspheric CO2 (PPM)

Archives

Blather

Uptime verified by Wormly.com

14 March 2007

locale.Error: unsupported locale setting

Python and bzr are great, but gee they suck sometimes. I hate locales generally. It's because I'm not hardcore, but Perl is always screwing up with locales. There are apparently easy ways to fix it and hard ways. I don't even understand the easy ways.

I solved this problem for Python by doing this in /usr/lib/python2.4/locale.py at line 417

- setlocale(locale.LC_CTYPE, "")
+ setlocale(locale.LC_CTYPE, None)

Apparently an empty string is an invalid locale but a Python null is OK.

Comments

  1. Thanks a lot

    this solution solve my problem

    Rogerio / 11:08pm / 24 June 2008

  2. Who’d think any of this stuff would ever actually be useful?

    Ryan / 11:11pm / 24 June 2008

  3. hey thank you, had a similar error trying to import wx in a python script this fix’s the problem. much appreciated..

    Josh / 4:40am / 20 August 2008

  4. I have been searching net a lot, and found resolution to my problem here – thanks. p.s. It may also help to remove quotation marks from /etc/environment

    Darek / 10:27pm / 18 October 2008

  5. solve problems with Trac also..

    m_ax / 7:34pm / 22 July 2009

  6. worked perfectly

    Anonymous / 12:23pm / 25 May 2010

  7. worked perfectly like a charm

    Anonymous / 12:24pm / 25 May 2010

  8. Thanks finally i got the solution………

    Raj / 1:00am / 30 November 2010

  9. Thanks, It helped.

    Ahmed El Refaey / 2:37am / 16 March 2011

  10. what for python 2.7

    abdullah / 9:22pm / 3 January 2015

  11. Don’t know about 2.7. I haven’t seen this issue for a long time.

    Ryan / 11:17am / 20 January 2015

Leave a comment

Markdown

0.091 seconds