[AG-DEV] AccessGrid setting locale?

Andrew Ford andrew.ford at rit.edu
Fri Apr 1 15:04:15 CDT 2011


Hi,

I noticed some interesting effects in a C++ application I'm developing that
calls various AG functions via the Python API. My app also uses wxWidgets,
and when I was experimenting with its logging functions, I noticed that the
timestamp format it uses changes after I call a standard import agversion
and agversion.select(3). I looked a bit for any locale setting AG does and
found locale.setlocale(locale.LC_ALL, 'C') in Toolkit.py. Commenting this
line out prevents the timestamp (presumably the associated locale settings
as well) from changing; I haven't tested whatever effect it may have on the
venue client. I'm curious as to what the rationale for this call is, as even
the python docs (http://docs.python.org/library/locale.html) say it is not
necessarily a good idea to set this in a context like this ("It is generally
a bad idea to call
setlocale()<http://docs.python.org/library/locale.html#locale.setlocale>in
some library routine, since as a side effect it affects the entire
program.") Any input on this issue would be great.

Thanks,
--Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/ag-dev/attachments/20110401/34827d74/attachment.htm>


More information about the ag-dev mailing list