[New-bugs-announce] [issue38597] C Extension import limit

Kevin Schlossser report at bugs.python.org
Sat Oct 26 15:48:20 EDT 2019


New submission from Kevin Schlossser <kevin.g.schlosser at gmail.com>:

System
Windows 7 x64 SP2
Ram 16GB
6 Core AMD @ 3.2ghz

CPython 3.7.2


C Extension (pyd) import cap.

There seems to be a cap on the number of extensions that a package is able to contain. I am able to import 123 extension modules that my package has but when i go to import number 124 i get the following traceback

ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

these extension modules are part of my package, importing an extension module from another package does not change this behavior. it is only when I import the 124th extension that is in my package does it occur. 

When I change the order of the imports the error does not follow the import. I end up getting the same error when the 124th extension gets loaded doesn't matter what extension it is. 

I have tried to see if maybe it was a module limit and I spread the imports across multiple files and it still fails when the 124th gets loaded. I also tried imp.load_dynamic and importlib.import_module and the same error occurs.

If there is a way to work around this limitation it would be very helpful.

----------
components: Extension Modules
messages: 355425
nosy: Kevin Schlossser
priority: normal
severity: normal
status: open
title: C Extension import limit
type: resource usage
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38597>
_______________________________________


More information about the New-bugs-announce mailing list