Ask Your Question
1

Why is the multiprocessing pool not working in Zope/Plone external methods and raising a TypeError indicating that it was expecting a string or Unicode object, but instead found NoneType?

asked 2023-07-04 09:12:43 +0000

devzero gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-07-04 09:26:02 +0000

nofretete gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-04 09:12:43 +0000

Seen: 9 times

Last updated: Jul 04 '23