It helps to know I'm not alone.

Here's my take:

The offending code in l10n/utils.py is

    locale.setlocale(locale.LC_ALL, locale.normalize(loc))

On my system (WIN2000)

loc is a locale code (en_US)
given a locale code, normalize returns a locale code en_US =>
en_US.ISO8859-1
given a language code, normalize returns a language code   en-US  =>
en-US

setlocale errors when its second parameter is a locale code. Ex.
'en_US', 'en_US.ISO8859-1'
setlocale works, or at least doesn't generate an exception, when given
a language code. Ex. 'en', 'en-US' (but not 'en-US.ISO8859-1')

Until this gets solved I am just replacing the get_locale_conv
function with:

def get_locale_conv(loc=None):
    locale.setlocale(locale.LC_ALL, 'en-US')  # not actually needed!
    return locale.localeconv()


You don't want to know how I feel about locales!
Karl

On Nov 11, 6:44 am, "Chris Moffitt" <[EMAIL PROTECTED]> wrote:
> Do the suggestions in this ticket help?
>
> http://www.satchmoproject.com/trac/ticket/311
>
> -Chris
>
> On Tue, Nov 11, 2008 at 5:36 AM, kbochert <[EMAIL PROTECTED]> wrote:
>
> > Seems like dozens of suggestions, many requiring tools I don't have,
> > or perhaps specific to platforms or languages or directory layouts.
> > I try one thing after another, never quite certain that a previous try
> > has not messed up  a later try.
> > The frustrating thing is that I have ZERO need for any of the locale
> > stuff.
> > It appears that the locale setup is hopelessly broken (at least for
> > me).
> > Is there any way to just disable the whole [EMAIL PROTECTED] thing???
>
> > Satchmo had such promise--
> > Karl
>
> > On Nov 11, 2:46 am, Günter Walser <[EMAIL PROTECTED]> wrote:
> > > There might be some hints when you searchhttp://
> > groups.google.com/group/satchmo-users?hl=enfor locale.
>
> > > -----Ursprüngliche Nachricht-----
> > > Von: [email protected] [mailto:
> > [EMAIL PROTECTED]
> > > Im Auftrag von kbochert
> > > Gesendet: Dienstag, 11. November 2008 11:32
> > > An: Satchmo users
> > > Betreff: Locale bug?
>
> > > I have installed Satchmo trunk, and Django 1.0
>
> > > browsing to /store I get what appears to be the correct Satcmo storefront
> > -
> > > searchbox, categories. links, etc.
>
> > > Clicking on one of the products goes to /store/products/robots_attack (or
> > > similar) and I get the base layout minus any css formatting, ending with
>
> > > Error
> > > There was an error with the store. The admin has been notified.
>
> > > - (presumably the un-styled content block)
>
> > > Some careful tracing shows that in  \satchmo\l10n\utils.py the function
> > > <get_locale_conv()> is raising  ImproperlyConfigured("bad
> > > settings.LANGUAGE_CODE")
>
> > > This is caused by the earlier call
> > > locale.setlocale(locale.LC_ALL, locale.normalize(loc)) not returning.
> > > (raising an exception) Which in turn is being caused by the
> > > <locale.normalize(loc)> call failing -- changing that line to:
>
> > > locale.setlocale(locale.LC_ALL, loc)
>
> > > allows get_locale_conv() to properly return the language and dictionary
> > of
> > > conversion parameters.
>
> > > Unfortunately this fix has no effect on the symptom.
>
> > > Is this a bug?
> > > Or am I way off track with versions or installations?
>
> > > Help
> > > Karl
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to