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

Brett Cannon brett at python.org
Fri Oct 26 21:55:46 CEST 2007


On 10/25/07, Facundo Batista <facundobatista at gmail.com> wrote:
> 2007/10/25, Facundo Batista <facundobatista at gmail.com>:
>
> > BTW, I'll leave the optimization of importing strptime one time,
> > there's no reason to try to import it everytime strptime() is called.
>
> No, I'm not. In consideration to the possible warning raised by Brett,
> I won't commit the change (it does not fix anything, just a marginal
> optimization, so there's no enough reason to bring a possible issue).
>
> For the record, I'm attaching the would-be patch.
>

I honestly have no problem if you do the import once, Facundo.  My
warning is so marginal I wouldn't worry about it.  Plus almost all
other code, C and Python alike, assume the import happens only once at
import so it shouldn't be a surprise to anyone.

> Thank you all!

Thanks for putting the time in to figure this out!

-Brett


More information about the Python-Dev mailing list