Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exception': 0.03; 'executed': 0.07; 'stops': 0.07; 'exception:': 0.09; 'nameerror:': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'idea:': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'shutdown.': 0.16; 'skip:o 70': 0.16; 'variables': 0.17; 'working.': 0.17; 'suddenly': 0.22; 'terminate': 0.22; 'defined': 0.22; 'runs': 0.22; 'script': 0.24; 'header:User-Agent:1': 0.26; '(most': 0.27; 'header:X-Complaints-To:1': 0.28; 'run': 0.28; 'writes:': 0.29; 'code': 0.31; 'point': 0.31; 'file': 0.32; 'getting': 0.33; 'traceback': 0.33; 'to:addr:python-list': 0.33; 'process,': 0.35; 'similar': 0.35; 'something': 0.35; 'received:org': 0.36; 'but': 0.36; 'modules': 0.36; 'should': 0.36; 'charset:us-ascii': 0.36; 'problems': 0.36; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'strange': 0.62; 'received:217': 0.68; 'lose': 0.71; 'email addr:gmail.com"': 0.84; 'online,': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dieter Maurer Subject: Re: Daemon loses __file__ reference after a while. Date: Tue, 24 Jul 2012 16:59:27 +0200 References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gmane-NNTP-Posting-Host: pd9e093e1.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) Cancel-Lock: sha1:QRzJvA0ueJBFXojRdCCay6DtaOM= 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1343141983 news.xs4all.nl 6888 [2001:888:2000:d::a6]:48809 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25994 "ivdneut@gmail.com" writes: > I have a daemon process that runs for a considerable amount of time (weeks on end) without any problems. At some point I start getting the exception: > > Exception info: Traceback (most recent call last): > File "scheduler.py", line 376, in applyrule > result = execrule(rule_code) > File "scheduler.py", line 521, in execrule > rulepath = os.path.dirname(__file__)+"/"+'/'.join(rule['modules'])+"/"+rule['rulename'] > NameError: name '__file__' is not defined > > This section of the code is executed in this process *all the time*, but suddenly stops working. I have been searching for similar issues online, but only come accross people having problems because they run the script interactively. This is not the case here. This is strange indeed. I have only one vague idea: should something try to terminate the process, modules would start to lose their variables during shutdown.