I’m trying to use a Python plugin which is divided across several files.
It works fine when there is only one file in the manifest.json. However, when a second file is added, initialisation fails with:
“Middleware initialization error: [Errno 2] No such file or directory: ‘/middleware.py’”.
The bundle has been downloaded and unpacked correctly, and both files are present at:
I suspect this may be related to https://github.com/TykTechnologies/tyk/issues/1839, which describes a similar bug for JSVM.
Reviewing the source code here:
it seems that this is a bug; that code will always set the path to /middleware.py, as starting with the / creates an absolute path.