Issue2031

classification
Title: threading -- `thread.daemon = True` doesn't work as expected
Type: behaviour Severity: normal
Components: Library Versions: Jython 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, untothebreach, zyasoft
Priority: high Keywords:

Created on 2013-03-23.18:19:50 by untothebreach, last changed 2014-06-19.04:54:37 by zyasoft.

Files
File name Uploaded Description Edit Remove
test.py untothebreach, 2013-03-23.18:19:50 Simple example of thread daemonizing that has different behavior on Jython as opposed to CPython
Messages
msg7968 (view) Author: Paul Woolcock (untothebreach) Date: 2013-03-23.18:19:50
Summary:

In the CPython docs for the `threading` module, it lists this interface as the "old" interface:

    >>> Thread().setDaemon()
    >>> Thread().isDaemon()
    True|False

and this is the "new" interface:

    >>> Thread().daemon = True|False
    >>> Thread().daemon
    True|False


In Jython 2.7b1, using the "new" interface does not seem to actually daemonize the thread. Programs that use the "new" interface require a Ctrl-C to exit, as the threads are still foreground threads when the program finishes. I have uploaded a simple example.

I brought this up in #jython, and <agronholm> suggested that it was probably just an oversight, and that I should file a bug for it.
msg7971 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2013-03-23.20:22:12
It probably is an oversight - the threading module needs attention...
msg8704 (view) Author: Jim Baker (zyasoft) Date: 2014-06-19.04:54:37
Fixed as of http://hg.python.org/jython/rev/b236e2db7a80

There was a duplicate bug report in #2125
History
Date User Action Args
2014-06-19 04:54:37zyasoftsetstatus: open -> closed
resolution: fixed
messages: + msg8704
nosy: + zyasoft
2013-03-23 20:22:12fwierzbickisetpriority: high
nosy: + fwierzbicki
messages: + msg7971
2013-03-23 18:25:51alex.gronholmsetcomponents: + Library
2013-03-23 18:19:50untothebreachcreate