Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!multikabel.net!newsfeed20.multikabel.net!amsnews11.chello.com!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'attribute': 0.07; 'url:pypi': 0.08; 'python': 0.08; '>>>>': 0.09; 'url:peps': 0.09; 'error:': 0.10; 'am,': 0.12; 'cc:addr:python-list': 0.15; 'installed,': 0.16; 'wrote:': 0.16; 'subject:Questions': 0.18; 'jan': 0.19; 'cheers,': 0.20; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'received:209.85.212.46': 0.23; 'received:mail-vw0-f46.google.com': 0.23; 'pep': 0.23; 'url:dev': 0.23; 'cc:2**0': 0.25; 'process,': 0.25; 'sat,': 0.25; 'module': 0.26; 'skip:[ 10': 0.27; 'message-id:@mail.gmail.com': 0.28; 'example': 0.28; "skip:' 10": 0.29; 'print': 0.29; 'installed': 0.29; 'cc:addr:python.org': 0.29; 'seem': 0.29; 'chris': 0.30; 'modules': 0.32; 'instead': 0.33; 'named': 0.33; 'object': 0.33; 'received:209.85.212': 0.34; 'someone': 0.34; 'something': 0.35; 'url:python': 0.36; 'david': 0.36; 'none': 0.36; 'link,': 0.36; 'skip:" 10': 0.36; 'reference': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'could': 0.37; 'received:209.85': 0.38; 'url:org': 0.39; 'received:209': 0.39; 'subject:: ': 0.39; 'packages': 0.40; 'got': 0.40; 'more': 0.61; 'your': 0.61; 'further': 0.64; 'easy_install': 0.84; 'partially': 0.84; 'sender:addr:chris': 0.84; 'yielded': 0.84; 'confusion.': 0.91; 'surprise': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=f/OUZwKp081cO4X0uuMT1v1ABB2vzPjgi9dhXAl7uH4=; b=LM/+Vl2RfpY1d2Tf75FOp/yZROIyBRi6ljfp6tjnr4Q4bq1a9JE//CQanfokzq+hHj ub+XU+FP0NFRExDYPngM/kmcvoQO2i1TRUtARG0k2SFU7SP7OZQpC1wqSeeGBuTaXmro VRq44yFFPTq4LXjrROW6whNgkTNS6+it47+2E= MIME-Version: 1.0 Sender: chris@rebertia.com In-Reply-To: <4F23FE17.6090904@lambsys.com> References: <4F23FE17.6090904@lambsys.com> Date: Sat, 28 Jan 2012 12:05:25 -0800 X-Google-Sender-Auth: r7T2Qb0MUu4LJOXQnob3VWYXH7A Subject: Re: Questions regarding the daemon module. From: Chris Rebert To: David Lambert Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1327781128 news.xs4all.nl 6886 [2001:888:2000:d::a6]:43855 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19556 On Sat, Jan 28, 2012 at 5:54 AM, David Lambert 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