imported method from module evaluates to None in some cases

Andrew andrewpadilla1 at gmail.com
Thu Nov 20 10:37:33 EST 2008


On Nov 20, 6:53 am, Hrvoje Niksic <hnik... at xemacs.org> wrote:
> Andrew <andrewpadil... at gmail.com> writes:
> > I'm having a problem in some zope (2.10) code (HTTPResponse.py) where
> > a method that gets imported somehow evaluates to None in certain cases
> > which causes a TypeError exception to be raised (eg: TypeError:
> > 'NoneType' object is not callable). The code excerpt is below where
> > the exception is raised on the line with the comment 'TypeError IS
> > RAISED HERE'.
>
> Could the "certain cases" involve automatic invocation of the close
> method at interpreter shutdown?  While the interpreter shuts down,
> module-level variables are set to None.  This is documented in some
> detail inhttp://www.python.org/doc/essays/cleanup/, steps C1-C3.

That's possible. I didn't know that. Now I guess the question for me
is why and where did the interpreter shutdown? I don't see log entries
relating to it. Is it possible for me to intercept an interpreter
shutdown so I can find out the location and possibly the reason why
the interpreter abruptly shuts down?




More information about the Python-list mailing list