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.

classification
Title: threading._DummyThread.__repr__ raises AssertionError
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Tom Myers, pitrou, tim.peters, xiang.zhang
Priority: normal Keywords: patch

Created on 2017-01-25 23:10 by Tom Myers, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue29376.patch xiang.zhang, 2017-02-03 14:58 review
Pull Requests
URL Status Linked Edit
PR 236 merged xiang.zhang, 2017-02-22 10:53
PR 329 merged xiang.zhang, 2017-02-27 03:16
PR 330 merged xiang.zhang, 2017-02-27 03:17
PR 703 larry, 2017-03-17 21:00
PR 552 closed dstufft, 2017-03-31 16:36
Messages (5)
msg286285 - (view) Author: Tom Myers (Tom Myers) Date: 2017-01-25 23:10
_DummyThread objects have _is_stopped = False, but _tstate_lock = None.  This causes an AssertionError in is_alive and __repr__ .

  File ".../cp34/lib/python3.4/threading.py", line 814, in __repr__
    self.is_alive() # easy way to get ._is_stopped set when appropriate
  File ".../cp34/lib/python3.4/threading.py", line 1110, in is_alive
    self._wait_for_tstate_lock(False)
  File ".../cp34/lib/python3.4/threading.py", line 1066, in _wait_for_tstate_lock
    assert self._is_stopped
AssertionError
msg286873 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-02-03 14:58
This seems an regression from #18808, so nosy Tim and Antoine. Since _DummyThread is always alive and daemonic, I think the solution could be overriding is_alive in _DummyThread and always returning True.
msg290370 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-03-24 23:38
New changeset 4b6c41768a15fc85e3069603ef89344bd97f79af by Xiang Zhang in branch '3.6':
bpo-29376: Fix assertion error in threading._DummyThread.is_alive() (GH-330)
https://github.com/python/cpython/commit/4b6c41768a15fc85e3069603ef89344bd97f79af
msg290371 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-03-24 23:38
New changeset 8400ae209b5fa3d3bdc39d3876eef13d1ea9a72a by Xiang Zhang in branch '3.5':
bpo-29376: Fix assertion error in threading._DummyThread.is_alive() (GH-329)
https://github.com/python/cpython/commit/8400ae209b5fa3d3bdc39d3876eef13d1ea9a72a
msg290372 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-03-24 23:38
New changeset f3a9faba4bad91286b78b498547de928078f55da by Xiang Zhang in branch 'master':
bpo-29376: Fix assertion error in threading._DummyThread.is_alive() (GH-236)
https://github.com/python/cpython/commit/f3a9faba4bad91286b78b498547de928078f55da
History
Date User Action Args
2022-04-11 14:58:42adminsetgithub: 73562
2017-03-31 16:36:31dstufftsetpull_requests: + pull_request1044
2017-03-24 23:38:21xiang.zhangsetmessages: + msg290372
2017-03-24 23:38:14xiang.zhangsetmessages: + msg290371
2017-03-24 23:38:08xiang.zhangsetmessages: + msg290370
2017-03-17 21:00:32larrysetpull_requests: + pull_request581
2017-02-27 03:47:40xiang.zhangsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-02-27 03:17:08xiang.zhangsetpull_requests: + pull_request290
2017-02-27 03:16:29xiang.zhangsetpull_requests: + pull_request289
2017-02-22 10:53:27xiang.zhangsetpull_requests: + pull_request197
2017-02-03 14:58:46xiang.zhangsetnosy: + tim.peters, pitrou
2017-02-03 14:58:27xiang.zhangsetfiles: + issue29376.patch

type: behavior
versions: + Python 3.5, Python 3.6, Python 3.7, - Python 3.4
keywords: + patch
nosy: + xiang.zhang

messages: + msg286873
stage: patch review
2017-01-25 23:10:08Tom Myerscreate