The fix itself is the same as for Python 2.5 – only the line numbers have changed.

Open the file /usr/lib/python2.6/locale.py and find the line containing en_gb (line 855) and add these lines (this works for Danish locales):

    'en_dk':                                'en_DK.ISO8859-1',
    'en_dk.iso88591':                       'en_DK.ISO8859-1',
    'en_dk@euro':                           'en_DK.ISO8859-15',

In order to avoid this change getting overwritten by packages updates, I use dpkg-divert:

$ sudo dpkg-divert --add --rename --divert /usr/lib/python2.6/locale.py.real /usr/lib/python2.6/locale.py
$ sudo cp /usr/lib/python2.6/locale.py.real /usr/lib/python2.6/locale.py

If you wish to remove the diversion (if the package is fixed to support you locale at some point) simply run

$ sudo dpkg-divert --rename --remove /usr/lib/python2.6/locale.py
Fixing unknown locale in Python 2.6

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Page optimized by WP Minify WordPress Plugin

Allan Willems Joergensen – OnDemand is Stephen Fry proof thanks to caching by WP Super Cache