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 mnewman
Recipients georg.brandl, mnewman
Date 2009-01-28.01:25:28
SpamBayes Score 1.0899059e-12
Marked as misclassified No
Message-id <1233105930.75.0.986865589873.issue5087@psf.upfronthosting.co.za>
In-reply-to
Content
This is related to:
http://bugs.python.org/issue3628
http://bugs.python.org/issue4808

I found in the example at the bottom of:
http://docs.python.org/3.0/library/queue.html
"t.set_daemon(True)"
won't work.

Python 3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from threading import Thread
>>> t = Thread()
>>> dir(t)
['_Thread__exc_info', '_Thread__initialized', '__class__',
'__delattr__', '__dic
t__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__',
'__gt__',
 '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__',
'__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__',
'__str__
', '__subclasshook__', '__weakref__', '_args', '_block', '_bootstrap',
'_bootstr
ap_inner', '_daemonic', '_delete', '_ident', '_initialized', '_kwargs',
'_name',
 '_note', '_set_daemon', '_started', '_stderr', '_stop', '_stopped',
'_target',
'_verbose', 'daemon', 'getName', 'ident', 'isAlive', 'isDaemon',
'is_alive', 'jo
in', 'name', 'run', 'setDaemon', 'setName', 'start']
>>> t.set_daemon(True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Thread' object has no attribute 'set_daemon'
>>> t.daemon
False
# This appears to be the proper method, unless "set_daemon" gets added
in (or setDaemon is used, but that appears to be depreciated syntax):
>>> t.daemon = True
>>> t.daemon
True

Please see the attached "queue_join.py" for my own working example. It
would be helpful to include the line:
>>> from threading import Thread
in the official example.
History
Date User Action Args
2009-01-28 01:25:30mnewmansetrecipients: + mnewman, georg.brandl
2009-01-28 01:25:30mnewmansetmessageid: <1233105930.75.0.986865589873.issue5087@psf.upfronthosting.co.za>
2009-01-28 01:25:28mnewmanlinkissue5087 messages
2009-01-28 01:25:28mnewmancreate