This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author misterunknown
Recipients docs@python, misterunknown
Date 2019-07-05.08:20:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1562314839.12.0.185461077472.issue37503@roundup.psfhosted.org>
In-reply-to
Content
I guess I found a bug in the documented Queue.join() example [1].

The problem is the break condition for the while loop of the worker. If the item is None, the loop breaks, but the worker never calls item.task_done(). Thus the q.join() statement never returns, because the last task (None) remains unfinished.

This should solve the issue:

```
if item is None:
  item.task_done()
  break
```

[1] https://docs.python.org/3/library/queue.html#queue.Queue.join
History
Date User Action Args
2019-07-05 08:20:39misterunknownsetrecipients: + misterunknown, docs@python
2019-07-05 08:20:39misterunknownsetmessageid: <1562314839.12.0.185461077472.issue37503@roundup.psfhosted.org>
2019-07-05 08:20:39misterunknownlinkissue37503 messages
2019-07-05 08:20:38misterunknowncreate