Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The multiprocessing pool is not working in Zope/Plone external methods because the Zope/Plone environment is not process-safe. This means that multiple Python processes cannot safely share the same Zope/Plone object instances, such as the request object or persistent objects. The multiprocessing module creates new processes and attempts to pass objects between them, which can lead to errors when working with Zope/Plone objects.

The TypeError indicating that it was expecting a string or Unicode object, but instead found NoneType is likely caused by a failure in passing an object to the multiprocessing pool. When this happens, None is returned instead of the expected string or Unicode object, leading to the error.

To work around this issue, it is recommended to use other concurrency approaches that work well with Zope/Plone, such as using Zope's built-in threaded approach or using an asynchronous framework like asyncio.