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


Groups > comp.lang.python > #25986

Re: Daemon loses __file__ reference after a while

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ivdneut@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.016
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'exception:': 0.09; 'messing': 0.09; 'nameerror:': 0.09; 'subject:while': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; '(sorry': 0.16; '24,': 0.16; 'ian.': 0.16; 'wrote:': 0.17; 'all,': 0.21; 'defined': 0.22; 'runs': 0.22; 'cc:2**0': 0.23; '&gt;': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'workaround': 0.29; 'starts': 0.29; "i'm": 0.29; 'skip:& 30': 0.30; 'point': 0.31; 'file': 0.32; 'another': 0.33; 'received:google.com': 0.34; 'problem,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'thank': 0.36; 'received:209': 0.37; 'well.': 0.37; 'subject:: ': 0.38; 'skip:o 20': 0.38; 'some': 0.38; 'google': 0.39; 'your': 0.60; 'july': 0.60; 'you.': 0.61; 'save': 0.61; 'email addr:gmail.com': 0.63; 'direct': 0.69; 'nagy': 0.84
Newsgroups comp.lang.python
Date Tue, 24 Jul 2012 05:44:23 -0700 (PDT)
In-Reply-To <mailman.2532.1343132964.4697.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=145.23.254.101; posting-account=W0yZ_goAAADAYkC_Qnpsg0MUvOyZ5Sm4
References <33df007b-6953-4606-871c-7a9b995739f2@googlegroups.com> <mailman.2532.1343132964.4697.python-list@python.org>
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-IP 145.23.254.101
MIME-Version 1.0
Subject Re: Daemon loses __file__ reference after a while
From "ivdneut@gmail.com" <ivdneut@gmail.com>
To comp.lang.python@googlegroups.com
Content-Type text/plain; charset=ISO-8859-1
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 <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>
Message-ID <mailman.2535.1343133866.4697.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1343133866 news.xs4all.nl 6896 [2001:888:2000:d::a6]:37916
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:25986

Show key headers only | View raw


On Tuesday, July 24, 2012 2:29:19 PM UTC+2, Laszlo Nagy wrote:
> On 2012-07-24 14:17, ivdneut@gmail.com wrote:
> &gt; Hello all,
> &gt;
> &gt; I have a deamon process that runs for some considerable time (weeks) without any problems. At some point it starts throwing the following exception:
> &gt;
> &gt;    File &quot;/some/path/scheduler.py&quot;, line 376, in applyrule
> &gt;      result = execrule(rule_code)
> &gt;    File &quot;/some/path/scheduler.py&quot;, line 521, in execrule
> &gt;      rulepath = os.path.dirname(__file__)+&quot;/&quot;+&#39;/&#39;.join(rule[&#39;modules&#39;])+&quot;/&quot;+rule[&#39;rulename&#39;]
> &gt; NameError: name &#39;__file__&#39; is not defined
> It is not a direct solution to your problem, but can you save the value 
> of os.path.dirname(__file__) into another variable?


That might be a workaround that I'm seriously pondering as well.

Thank you.

Ian.

(sorry for google messing up my posts)

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 05:17 -0700
  Re: Daemon loses __file__ reference after a while Laszlo Nagy <gandalf@shopzeus.com> - 2012-07-24 14:29 +0200
    Re: Daemon loses __file__ reference after a while "ivdneut@gmail.com" <ivdneut@gmail.com> - 2012-07-24 05:44 -0700
    Re: Daemon loses __file__ reference after a while "ivdneut@gmail.com" <ivdneut@gmail.com> - 2012-07-24 05:44 -0700

csiph-web