Message347310
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 |
|
Date |
User |
Action |
Args |
2019-07-05 08:20:39 | misterunknown | set | recipients:
+ misterunknown, docs@python |
2019-07-05 08:20:39 | misterunknown | set | messageid: <1562314839.12.0.185461077472.issue37503@roundup.psfhosted.org> |
2019-07-05 08:20:39 | misterunknown | link | issue37503 messages |
2019-07-05 08:20:38 | misterunknown | create | |
|