I am working on a project that shares chrome browsers , started using selenium package for several processes. Since these browsers (stored as list objects) are shared in processes using Manager.list() , I also want to provide the appropriate Manager.Lock() list for all processes so that processes get lock in the browser before accessing the URLs through This . However, I get an error regarding lock serialization as follows in the sample code:
>>> from multiprocessing import Manager >>> manager = Manager() >>> lock_list = manager.list() >>> lock_list.append(manager.Lock()) >>> print type(lock_list[0]) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<string>", line 2, in __getitem__ File "/usr/lib/python2.7/multiprocessing/managers.py", line 774, in _callmethod raise convert_to_error(kind, result) multiprocessing.managers.RemoteError: --------------------------------------------------------------------------- Unserializable message: ('#RETURN', <thread.lock object at 0x7fa2115452b0>) --------------------------------------------------------------------------- >>>
If someone can help me get around this, it will be really great. Thanks.
source share