Message 232326 - Python tracker

Message232326

Author wdoekes
Recipients vinay.sajip, wdoekes
Date 2014-12-08.20:23:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1418070202.44.0.213597405532.issue23010@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the quick response!

> Well, it's possible that you could configure handlers in the configuration for later use (i.e. at some point after the dictConfig() call returns).

After the dictConfig call returns, the StreamHandler/FileHandler is not referenced by anyone anymore. That's what causes the ResourceWarning. Unless I'm severely mistaken, there is no way to reach that old FileHandler instance.

> If you want to avoid opening the file until it's actually needed, you can specify delay=True.

I am aware of that, but that's a workaround, not a fix. (And it has drawbacks of its own, for example in forking and/or setuid situations.)

> Unless there's some reason you can't do that, or there's something I've overlooked, I think I should close this as invalid.

You could do that, but -- barring me overlooking something here -- I think that would only be correct if the dictionary that I passed to dictConfig is judged as being illegal, because it contains unused handlers.

The ResourceWarning thrown is hard to understand because of where it is raised (at random points in a different modules), so like it is now, it may dissuade users from enabling more (visual) warnings. I'd rather see a warning raised earlier from dictConfig() that I configured an unused handler, so I have a better indication of what to fix.
History
Date User Action Args
2014-12-08 20:23:22wdoekessetrecipients: + wdoekes, vinay.sajip
2014-12-08 20:23:22wdoekessetmessageid: <1418070202.44.0.213597405532.issue23010@psf.upfronthosting.co.za>
2014-12-08 20:23:22wdoekeslinkissue23010 messages
2014-12-08 20:23:22wdoekescreate