On Mar 16, 3:08 pm, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > Leo Kislov wrote: > > But you miss the fact that there is only one environment per process. > > Maybe there's a confusion. > The environment variable that I'm setting has noting to do with ldapsearch. I > use the environment variable as a filename to which ldapsearch can redirect > its > output. And that I do is because the output can be huge and useless. > Then I do some pattern matching on that file and filter my data and then > delete > it. > > If you think I still am missing something important, request you to describe > it.
Imagine this timeline: <thread1> os.environ['__kabc_ldap'] = '/tmp/tmp1' <thread1 suspended, thread2 starts to run> <thread2> os.environ['__kabc_ldap'] = '/tmp/tmp2' <thread2> launch ldapsearch (output goes to '/tmp/tmp2') <thread2 suspended, thread1 starts to run> <thread1> launch ldapsearch (output goes to '/tmp/tmp2' over output from ldapsearch launched from thread1) Seems like that's what is happening to your program. -- Leo -- http://mail.python.org/mailman/listinfo/python-list