[Python-Dev] Re: Be Honest about LC_NUMERIC [REPOST]

Martin v. Löwis martin at v.loewis.de
Tue Sep 2 05:58:53 EDT 2003


"Tim Peters" <tim.one at comcast.net> writes:

> > I'm asking because I'd like to see the specific problem that started
> > this thread solved,
> 
> At this point, can you state what that specific problem was <wink>?

The user was writing a gtk application (using pygtk), where gtk,
internally, would rely on C-library LC_NUMERIC following the local
conventions (I believe gtk would call snprintf to display some message
to the user).  The user then thought that calling locale.setlocale
would be sufficient, but it isn't, and there is no way to fix that
short of rewriting gtk.

> I'm finding it hard to believe that anyone other than me and the author has
> actually read the patch!  It's easy to understand.

On the surface, yes. However, it seems full of hidden assumptions that
are difficult to find out and consider. For example, what if the
platform snprintf choses to output the thousands-separator? I can't
see how that handled in the patch.

Regards,
Martin



More information about the Python-Dev mailing list