Making SocketHandler safe for use with non-pickleable objects

[email protected]
Newsgroups gmane.comp.python.devel
Message-ID <[email protected]>
I've been working on a bug in django where if you configure a logging.handlers.SocketHandler in the django logging config, it gets a TypeError because it tries to log a HttpRequest object, which can't be pickled.  I'm slowly coming to the conclusion that this isn't a django bug, and the right fix is to make SocketHandler (and DatagramHandler) be able to deal with this internally.

QueueHandler already does this, or at least the documentation says it does:

    prepare(record) ... removes unpickleable items from the record in-place.

It seems like SocketHandler should do the same thing.  Thoughts?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.