I really don;t think so. I looked at process mamangement in python. By default child process inherits all the environment variables from parent process. In case if a python application uses popen3 to run a command in a subprocess(child) then, before that whatever Environment variables u create or set in the code are passed on to the sub process and the sub process setlocale is picking up the LANG environment variable defined in the parent process.
But the problem remains, if a process sets environment variable from the code, and other part of code which uses setlocale need be able to see this environment variable. Which is not happening. But if I print the environment variable in the other parts of the code, they all printing that the environmental variable is set. On 5/11/05, Andrew MacIntyre <[EMAIL PROTECTED]> wrote: > > From: Nalli Dinesh > > > > Hmm. I tried out this patch. This patch is about adding > > update function to os.py. > > Update is removed in python2.4, now adding this patch gave me > > access to use update in python2.4 My problem persists. > > locale.setlocale doesn't work even though we set LANG > > environment variable using update function. > > I don;t know whats going on. locale.setlocale worked > > perfectly when I set LANG environment variable with > > os.putenv,under python 2.3.5. > > As this is on Windows, you'll also need to keep in mind that the > standard Python 2.4[.x] distribution is built with MSVC 7.1, whereas > Python 2.3.x distributions were built with MSVC 6. There are 2 > different C runtime libraries involved, and the issue you see may > be due to differences at this level rather than in the Python codebase. > > Python 2.4[.x] is still buildable with MSVC 6 (thanks to Raymond > Hettinger), so if you have access to that compiler you can check this > out. > > ---------------------------------------------------------------------- > Andrew MacIntyre \ email: [EMAIL PROTECTED] > Planning Branch \ tel: +61 2 6256 2812 > Australian Broadcasting Authority \ fax: +61 2 6253 3277 > -> "These thoughts are mine alone!" <--------------------------------- > _______________________________________________ Python-win32 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-win32
