Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #25994

Re: Daemon loses __file__ reference after a while.

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 <python-python-list@m.gmane.org>
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 <dieter@handshake.de>
Subject Re: Daemon loses __file__ reference after a while.
Date Tue, 24 Jul 2012 16:59:27 +0200
References <bfa7b7ac-d288-4889-8e48-dd0ff0cad711@googlegroups.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2543.1343141983.4697.python-list@python.org> (permalink)
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

Show key headers only | View raw


"ivdneut@gmail.com" <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.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Daemon loses __file__ reference after a while. "ivdneut@gmail.com" <ivdneut@gmail.com> - 2012-07-24 04:48 -0700
  Re: Daemon loses __file__ reference after a while. Ervin Hegedüs <airween@gmail.com> - 2012-07-24 14:24 +0200
    Re: Daemon loses __file__ reference after a while. "ivdneut@gmail.com" <ivdneut@gmail.com> - 2012-07-24 05:41 -0700
    Re: Daemon loses __file__ reference after a while. "ivdneut@gmail.com" <ivdneut@gmail.com> - 2012-07-24 05:41 -0700
  Re: Daemon loses __file__ reference after a while. Laszlo Nagy <gandalf@shopzeus.com> - 2012-07-24 14:31 +0200
  Re: Daemon loses __file__ reference after a while. Dieter Maurer <dieter@handshake.de> - 2012-07-24 16:59 +0200
    Re: Daemon loses __file__ reference after a while. Paul Rubin <no.email@nospam.invalid> - 2012-07-24 12:32 -0700
      Re: Daemon loses __file__ reference after a while. Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-24 14:08 -0600
  Re: Daemon loses __file__ reference after a while. Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-24 14:02 -0600

csiph-web