How to set Python multiprocessing pickle protocol for 3.x to 2.x IPC

此生再无相见时 提交于 2019-12-12 14:05:38

问题


I am trying to establish really basic string-message IPC (no need for objects or anything fancy like that) between two Python processes on the same machine, the listener in Py2 and the client in Py3. This doesn't work out of the box because Py3 MP defaults to Pickle protocol 3, which doesn't exist for the Py2 listener, so the listener crashes on an unrecognized pickle protocol. I wish MP wouldn't pickle at all, I'm just sending strings over the wire and don't see why I should be forced to go through a Pickling step if I choose not to, but if I can't turn pickling off entirely, then how to I tell the client in Py3 to use pickle protocol 0 (or 1 or 2)? I have looked for a solution to this seemingly straightforward question and cannot find an answer, much to my astonishment.

Thank you.

来源:https://stackoverflow.com/questions/54135972/how-to-set-python-multiprocessing-pickle-protocol-for-3-x-to-2-x-ipc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!