Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue30301

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:multiprocessing: AttributeError: 'SimpleQueue' object has no attribute '_poll'
Type:behaviorStage:resolved
Components:Library (Lib), WindowsVersions:Python 3.7, Python 3.6, Python 3.5
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Daniel Moore, davin, paul.moore, serhiy.storchaka, steve.dower, tim.golden, xiang.zhang, zach.ware
Priority:normalKeywords:

Created on2017-05-07 19:01 byDaniel Moore, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 1601mergedxiang.zhang,2017-05-16 08:06
PR 1627mergedxiang.zhang,2017-05-17 13:11
PR 1628mergedxiang.zhang,2017-05-17 13:12
Messages (7)
msg293209 -(view)Author: Daniel Moore (Daniel Moore)Date: 2017-05-07 19:01
I originally posted this as a question on StackOverflow thinking I was doing something wrong:http://stackoverflow.com/questions/43834494/python-3-6-attributeerror-simplequeue-object-has-no-attribute-poll/43835368#43835368But I think I found the solution and answered my own question. I'm pretty sure you need to set:self._poll = self._reader.pollin the __setstate__ method in the SimpleQueue class of queues.py from the multiprocessing library. Otherwise, I'd love to know an alternative solution.Thanks!
msg293753 -(view)Author: Xiang Zhang (xiang.zhang)*(Python committer)Date: 2017-05-16 07:51
Related commit isbdb1cf1ca56db25b33fb15dd91eef2cc32cd8973. A simple reproduce snippet:import multiprocessing as mpdef 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()
msg293774 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2017-05-16 16:44
LGTM. But can you convert the reproducer to a test?
msg293838 -(view)Author: Xiang Zhang (xiang.zhang)*(Python committer)Date: 2017-05-17 04:20
Thanks for your reply Serhiy. Test added. :-)
msg293850 -(view)Author: Xiang Zhang (xiang.zhang)*(Python committer)Date: 2017-05-17 13:04
New changeset6f75bc003ab4d5294b0291289ae03f7a8d305f46 by Xiang Zhang in branch 'master':bpo-30301: Fix AttributeError when using SimpleQueue.empty() (#1601)https://github.com/python/cpython/commit/6f75bc003ab4d5294b0291289ae03f7a8d305f46
msg293853 -(view)Author: Xiang Zhang (xiang.zhang)*(Python committer)Date: 2017-05-17 14:02
New changeset9081b36f330964faa4dee3af03228d2ca7c71835 by Xiang Zhang in branch '3.5':bpo-30301: Fix AttributeError when using SimpleQueue.empty() (#1601) (#1627)https://github.com/python/cpython/commit/9081b36f330964faa4dee3af03228d2ca7c71835
msg293854 -(view)Author: Xiang Zhang (xiang.zhang)*(Python committer)Date: 2017-05-17 14:03
New changeset43d4c0329e2348540a3a16ac61b3032f04eefd34 by Xiang Zhang in branch '3.6':bpo-30301: Fix AttributeError when using SimpleQueue.empty() (#1601) (#1628)https://github.com/python/cpython/commit/43d4c0329e2348540a3a16ac61b3032f04eefd34
History
DateUserActionArgs
2022-04-11 14:58:46adminsetgithub: 74487
2017-05-17 14:06:16xiang.zhangsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-05-17 14:03:40xiang.zhangsetmessages: +msg293854
2017-05-17 14:02:58xiang.zhangsetmessages: +msg293853
2017-05-17 13:12:02xiang.zhangsetpull_requests: +pull_request1719
2017-05-17 13:11:42xiang.zhangsetpull_requests: +pull_request1718
2017-05-17 13:04:02xiang.zhangsetmessages: +msg293850
2017-05-17 04:20:46xiang.zhangsetmessages: +msg293838
2017-05-16 16:44:43serhiy.storchakasetnosy: +serhiy.storchaka
messages: +msg293774
2017-05-16 08:06:05xiang.zhangsetpull_requests: +pull_request1692
2017-05-16 07:51:13xiang.zhangsetversions: + Python 3.5, Python 3.7
nosy: +xiang.zhang

messages: +msg293753

type: crash -> behavior
stage: patch review
2017-05-10 23:52:33vstinnersettitle: “AttributeError: 'SimpleQueue' object has no attribute '_poll'” -> multiprocessing: AttributeError: 'SimpleQueue' object has no attribute '_poll'
2017-05-09 10:02:10xiang.zhangsetnosy: +davin
2017-05-07 19:01:50Daniel Moorecreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp