Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #19556
| References | <4F23FE17.6090904@lambsys.com> |
|---|---|
| Date | 2012-01-28 12:05 -0800 |
| Subject | Re: Questions regarding the daemon module. |
| From | Chris Rebert <clp2@rebertia.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.5182.1327781128.27778.python-list@python.org> (permalink) |
On Sat, Jan 28, 2012 at 5:54 AM, David Lambert <dave@lambsys.com> wrote: > I was looking for a simple way to daemonize a Python process, and found: > > http://www.python.org/dev/peps/pep-3143/ > > I used easy_install to add this package (I thought), but when I attempted to > use the example in the above link, I got the error: > > > AttributeError: 'module' object has no attribute 'DaemonContext' > > To my surprise when looking at the module that was installed, I found > something completely different to what was in the documentation: > >>>> dir(daemon) > ['__builtins__', '__doc__', '__file__', '__name__', '__package__', > 'basic_daemonize', 'checkPID', 'daemonize', 'errno', 'os', 'sys', > 'writePID'] >>>> >>>> print daemon.__doc__ > None >>>> >>>> print daemon.daemonize.__doc__ > None >>>> > > > Further experimentation with this module yielded a working daemon, but I am > concerned regarding its parentage and lack of documentation. Could someone > explain these discrepancies? You seem to have installed the "daemon" package: http://pypi.python.org/pypi/daemon/ If you read the PEP more closely, you'll see that the PEP 3143 reference implementation is instead the "python-daemon" package: http://pypi.python.org/pypi/python-daemon/ Both packages provide modules named "daemon", partially hence your confusion. Cheers, Chris
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Questions regarding the daemon module. Chris Rebert <clp2@rebertia.com> - 2012-01-28 12:05 -0800
csiph-web