[Python-Dev] Fwd: Deadlock by a second import in a thread

Christian Heimes lists at cheimes.de
Fri Oct 26 04:51:12 CEST 2007


Facundo Batista wrote:
> It's a matter of perspective, yes. But I'll close this bug, because
> he's hitting the problem through a weird way, doing something that he
> shouldn't.
> 
> The real problem here, if any, is that you can not make a second
> import in another thread. Feel free to open a bug for this, but
> addressing this specifically.

I had a look into the code. I think it's possible to get rid of most
imports by caching the import in a static variable. For warnings, time
and resource it's even possible to import the module in module
initializer but not for strptime. It depends on a Python module that
imports datetime and time.

I could look into the matter and provide a patch for the trunk.

Christian



More information about the Python-Dev mailing list