Author vinay.sajip
Recipients OG7, amaury.forgeotdarc, jnoller, pitrou, vinay.sajip
Date 2009-11-24.18:23:45
SpamBayes Score 1.71392e-07
Marked as misclassified No
Message-id <875918.56341.qm@web25804.mail.ukl.yahoo.com>
In-reply-to <1259086135.3450.23.camel@localhost>
Content
> Why is this exactly? Why do you want to keep handlers until shutdown

> rather than dispose of them when they aren't used anymore?

Typically handlers are only instantiated when being added to loggers, and loggers live for the lifetime of the process so those handler references will typically be persistent. However, if a handler is closed (typically after removing from a handler), it's removed from the list and would not cause a memory leak.

> Moreover, closing in atexit is rather bad because the resources
> necessary for proper closing (files, sockets...) may already have been
> freed.

That's potentially true, but it's behaviour which has been there from the beginning so ISTM it needs to be there for backward compatibility reasons :-( When logging.raiseExceptions is True (the default) any exceptions in shutdown() would be raised, but this doesn't appear to happen in practice.
History
Date User Action Args
2009-11-24 18:23:47vinay.sajipsetrecipients: + vinay.sajip, amaury.forgeotdarc, pitrou, OG7, jnoller
2009-11-24 18:23:46vinay.sajiplinkissue6615 messages
2009-11-24 18:23:45vinay.sajipcreate