Re: import in threads: crashes strange exceptions on dual core machines

2006-11-01 Thread robert
Steve Holden wrote: Klaas wrote: robert wrote: Klaas wrote: It seems clear that the import lock does not include fully-executing the module contents. To fix this, just import cookielib before the What is the exact meaning of not include fully-executing - regarding the examples import

Re: import in threads: crashes strange exceptions on dual core machines

2006-10-31 Thread robert
Klaas wrote: It seems clear that the import lock does not include fully-executing the module contents. To fix this, just import cookielib before the What is the exact meaning of not include fully-executing - regarding the examples import cookielib ? Do you really mean the import statement can

Re: import in threads: crashes strange exceptions on dual core machines

2006-10-31 Thread Klaas
robert wrote: Klaas wrote: It seems clear that the import lock does not include fully-executing the module contents. To fix this, just import cookielib before the What is the exact meaning of not include fully-executing - regarding the examples import cookielib ? Do you really mean the

Re: import in threads: crashes strange exceptions on dual core machines

2006-10-31 Thread Steve Holden
Klaas wrote: robert wrote: Klaas wrote: It seems clear that the import lock does not include fully-executing the module contents. To fix this, just import cookielib before the What is the exact meaning of not include fully-executing - regarding the examples import cookielib ? Do you really

import in threads: crashes strange exceptions on dual core machines

2006-10-30 Thread robert
I get python crashes and (in better cases) strange Python exceptions when (in most cases) importing and using cookielib lazy on demand in a thread. It is mainly with cookielib, but remember the problem also with other imports (e.g. urllib2 etc.). And again very often in all these cases where I

Re: import in threads: crashes strange exceptions on dual core machines

2006-10-30 Thread Klaas
It seems clear that the import lock does not include fully-executing the module contents. To fix this, just import cookielib before the threads are spawned. Better yet, use your own locks around the acquisition of the opener instance (this code seems fraughtfully thread-unsafe--fix that and you