Re: Logging in __del__()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fredrik Lundh

    Re: Logging in __del__()

    Robert Rawlins wrote:
    I then get the following exception thrown when running my code:
    When the application is running, or when it is shutting down?
    Traceback (most recent call last):
    File "/usr/lib/python2.5/logging/handlers.py", line 73, in emit
    if self.shouldRoll over(record):
    File "/usr/lib/python2.5/logging/handlers.py", line 147, in shouldRollover
    self.stream.see k(0, 2) #due to non-posix-compliant Windows feature
    ValueError: I/O operation on closed file
    >
    Does anyone have any ideas as to what I’m doing wrong here? Is this a
    known issue which has a neat little work around?
    Python makes no guarantees that it will tear down your objects before it
    tears down the library's objects (or the library itself). See e.g.



    (old and probably somewhat outdated, but you get the idea)

    I'd just put a try/except around it, and ignore any exceptions that may
    occur.

    </F>

Working...