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
multiprocessing: AttributeError: 'SimpleQueue' object has no attribute '_poll' #74487
Comments
I originally posted this as a question on StackOverflow thinking I was doing something wrong: But I think I found the solution and answered my own question. I'm pretty sure you need to set: self._poll = self._reader.poll in the __setstate__ method in the SimpleQueue class of queues.py from the multiprocessing library. Otherwise, I'd love to know an alternative solution. Thanks! |
Related commit is bdb1cf1. A simple reproduce snippet: import multiprocessing as mp
def foo(q):
q.put('hello')
assert not q.empty()
if __name__ == '__main__':
mp.set_start_method('spawn')
q = mp.SimpleQueue()
p = mp.Process(target=foo, args=(q,))
p.start()
print(q.get())
p.join() |
LGTM. But can you convert the reproducer to a test? |
Thanks for your reply Serhiy. Test added. :-) |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: