This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vinay.sajip
Recipients fviard, r.david.murray, vinay.sajip
Date 2015-11-24.23:03:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1448406192.11.0.819635226067.issue25668@psf.upfronthosting.co.za>
In-reply-to
Content
handle() and emit() are high level methods of a handler, and format() is at a lower level. Not all emit() methods will call format(). For example, socket-based and queue-based handlers don't. So it is not in general possible to separate format() out - you will need to have a customised handler to deal with your somewhat unusual use case, and do whatever you need in there.

Threading is a complex area and while logging is one specific case you may have come across, it's entirely possible to have a situation with any other lock (e.g. in your application) where acquiring the lock and calling __unicode__() on one of your objects will also result in a deadlock. So your proposal wouldn't fix the problem in a general way - just move it so that you might avoid the problem, but a more esoteric use of locks wouldn't necessarily work. In general, to avoid deadlocks, you have to acquire locks in a fixed order, and only you know what those locks are - so you can implement the appropriate acquisition and release code in your handle().
History
Date User Action Args
2015-11-24 23:03:12vinay.sajipsetrecipients: + vinay.sajip, r.david.murray, fviard
2015-11-24 23:03:12vinay.sajipsetmessageid: <1448406192.11.0.819635226067.issue25668@psf.upfronthosting.co.za>
2015-11-24 23:03:12vinay.sajiplinkissue25668 messages
2015-11-24 23:03:11vinay.sajipcreate