|
From: Fernando P. <Fer...@co...> - 2005-06-23 16:58:06
|
Nicholas Young wrote: > On Wed, 2005-06-22 at 11:45 -0600, Fernando Perez wrote: > >>os.environ['TEXMFOUTPUT'] = '/some/path' > > > According to the online docs > (http://docs.python.org/lib/os-procinfo.html) setting os.environ isn't > safe/available for all platforms. You can use the subprocess module to > set the environment of a subprocess under python 2.4 but I don't think > there's a simple way to do this and capture the output for earlier > versions. Well, after reading that I get that os.environ _is_ writable everywhere, it's just that it may leak memory in OSX/BSD. What's not always available is the putenv() call, but python will find its way around it if needed. Since this would be a once-only call, I think that leaking a few bytes is an acceptable price to pay to prevent a crash if the user happens to be positioned on a non-writable dir. Cheers, f |