Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow connect_multiprocess() and connect_thread() to pickle #412

Merged
merged 1 commit into from
Dec 25, 2020

Conversation

dand-oss
Copy link

Nested Function fails pickle:

AttributeError: Can't pickle local object 'connect_multiprocess..server'

File "C:\Python\lib\site-packages\rpyc-4.1.5-py3.8.egg\rpyc\utils\factory.py", line 327, in connect_multiprocess
t.start()
File "C:\Python\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\Python\lib\multiprocessing\context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Python\lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
File "C:\Python\lib\multiprocessing\popen_spawn_win32.py", line 93, in init
reduction.dump(process_obj, to_child)
File "C:\Python\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'connect_multiprocess..server'

@comrumino comrumino self-assigned this Oct 31, 2020
@comrumino comrumino added the To Start Description reviewed and a maintainer needs "to start" triage label Oct 31, 2020
@comrumino
Copy link
Collaborator

The comments are all coding style related and a little overly fussy. They should be an easy fix and I'll take another look after that. Looks like a solid change overall. Thank you for taking the time!

@comrumino comrumino added Triage Investigation by a maintainer has started and removed To Start Description reviewed and a maintainer needs "to start" triage labels Oct 31, 2020
Nested Function fails pickle

  File "C:\Python\lib\site-packages\rpyc-4.1.5-py3.8.egg\rpyc\utils\factory.py", line 327, in connect_multiprocess
    t.start()
  File "C:\Python\lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
  File "C:\Python\lib\multiprocessing\context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "C:\Python\lib\multiprocessing\context.py", line 327, in _Popen
    return Popen(process_obj)
  File "C:\Python\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Python\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'connect_multiprocess.<locals>.server'
@comrumino
Copy link
Collaborator

So, to give you credit for your effort. I'll go ahead and merge this. But, partial compilation of a function works just as well here. Plus there a few corner cases ya missed.

@comrumino comrumino merged commit f32fbd8 into tomerfiliba-org:master Dec 25, 2020
@comrumino comrumino added Done The issue discussion is exhausted and is closed w/ comment and removed Triage Investigation by a maintainer has started labels Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Done The issue discussion is exhausted and is closed w/ comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants