Skip to content
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

threading._DummyThread.__repr__ raises AssertionError #73562

Closed
TomMyers mannequin opened this issue Jan 25, 2017 · 5 comments
Closed

threading._DummyThread.__repr__ raises AssertionError #73562

TomMyers mannequin opened this issue Jan 25, 2017 · 5 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@TomMyers
Copy link
Mannequin

TomMyers mannequin commented Jan 25, 2017

BPO 29376
Nosy @tim-one, @pitrou, @zhangyangyu
PRs
  • bpo-29376: Fix assertion error in threading._DummyThread.is_alive() #236
  • bpo-29376: Fix assertion error in threading._DummyThread.is_alive() #329
  • bpo-29376: Fix assertion error in threading._DummyThread.is_alive() #330
  • [Do Not Merge] Sample of CPython life with blurb. #703
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • Files
  • issue29376.patch
  • 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:

    assignee = None
    closed_at = <Date 2017-02-27.03:47:40.676>
    created_at = <Date 2017-01-25.23:10:08.930>
    labels = ['3.7', 'type-bug', 'library']
    title = 'threading._DummyThread.__repr__ raises AssertionError'
    updated_at = <Date 2017-03-31.16:36:31.580>
    user = 'https://bugs.python.org/TomMyers'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:31.580>
    actor = 'dstufft'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-02-27.03:47:40.676>
    closer = 'xiang.zhang'
    components = ['Library (Lib)']
    creation = <Date 2017-01-25.23:10:08.930>
    creator = 'Tom Myers'
    dependencies = []
    files = ['46502']
    hgrepos = []
    issue_num = 29376
    keywords = ['patch']
    message_count = 5.0
    messages = ['286285', '286873', '290370', '290371', '290372']
    nosy_count = 4.0
    nosy_names = ['tim.peters', 'pitrou', 'xiang.zhang', 'Tom Myers']
    pr_nums = ['236', '329', '330', '703', '552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue29376'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    @TomMyers
    Copy link
    Mannequin Author

    TomMyers mannequin commented Jan 25, 2017

    _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

    @TomMyers TomMyers mannequin added the stdlib Python modules in the Lib dir label Jan 25, 2017
    @zhangyangyu
    Copy link
    Member

    This seems an regression from bpo-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.

    @zhangyangyu zhangyangyu added 3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error labels Feb 3, 2017
    @zhangyangyu
    Copy link
    Member

    New changeset 4b6c417 by Xiang Zhang in branch '3.6':
    bpo-29376: Fix assertion error in threading._DummyThread.is_alive() (GH-330)
    4b6c417

    @zhangyangyu
    Copy link
    Member

    New changeset 8400ae2 by Xiang Zhang in branch '3.5':
    bpo-29376: Fix assertion error in threading._DummyThread.is_alive() (GH-329)
    8400ae2

    @zhangyangyu
    Copy link
    Member

    New changeset f3a9fab by Xiang Zhang in branch 'master':
    bpo-29376: Fix assertion error in threading._DummyThread.is_alive() (GH-236)
    f3a9fab

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant