Should PyImport_ImportModule be threadsafe when importing from zipfiles?

Chris Angelico rosuav at gmail.com
Thu Feb 20 12:58:11 EST 2020


On Fri, Feb 21, 2020 at 3:06 AM Geoff Bache <geoff.bache at gmail.com> wrote:
>
> Hi Chris,
>
> Yes, I've tried both of these things already. I can confirm there are multiple calls, and that pre-importing the module fixes it. But pre-importing it is not a solution in practice.
>

Cool, good to know.

Crazy idea: What would happen if you stick something temporarily into
sys.modules["b"], then when you're done importing, set the module back
into there? Might not help, but would be interesting to try, and might
show a bit more of what's going on.

ChrisA


More information about the Python-list mailing list