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


Groups > comp.lang.python > #25988

Re: Daemon loses __file__ reference after a while

From "ivdneut@gmail.com" <ivdneut@gmail.com>
Newsgroups comp.lang.python
Subject Re: Daemon loses __file__ reference after a while
Date 2012-07-24 05:44 -0700
Organization http://groups.google.com
Message-ID <c9a4e2f7-6413-4737-bb9e-c763a305895b@googlegroups.com> (permalink)
References <33df007b-6953-4606-871c-7a9b995739f2@googlegroups.com> <mailman.2532.1343132964.4697.python-list@python.org>

Show all headers | 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 | 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