This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients georg.brandl, loewis, r.david.murray, rg3
Date 2009-04-22.20:26:45
SpamBayes Score 7.945107e-08
Marked as misclassified No
Message-id <1240432006.55.0.719566812354.issue5815@psf.upfronthosting.co.za>
In-reply-to
Content
OK, it turns out that this is one of a class of known bugs of long
standing (see issue554676 and issue1080864, for example).  The
recommended solution is to not use locale.getdefaultlocale, but to use
locale.getperferredencoding.  I have confirmed that that works for the
case of ca_ES.UTF-8@valencia in python2.5.

There is at least a doc bug here, since no mention of this
fragility/recommendation is made in the getdefaultlocale documentation.

Using getpreferredencoding seems to be the correct solution to your
problem.  However, the locale.py module contains a number of examples of
modifiers in the locale_alias table.  Presumably this case could be
added, but it is not clear to me what the policy is on that at this
time, so I'm adding Martin to the nosy list looking for some guidance.
History
Date User Action Args
2009-04-22 20:26:46r.david.murraysetrecipients: + r.david.murray, loewis, georg.brandl, rg3
2009-04-22 20:26:46r.david.murraysetmessageid: <1240432006.55.0.719566812354.issue5815@psf.upfronthosting.co.za>
2009-04-22 20:26:45r.david.murraylinkissue5815 messages
2009-04-22 20:26:45r.david.murraycreate