Nathan Jensen added the comment:

I'm not sure this was fixed in an optimal way.

We have a set of processes using the SocketHandler to send log records to a 
single log process.  Some of these log records have the msg attribute as a 
dictionary that contained a variety of extra information about the event that 
was being logged.  After this change, our process receiving the events and 
logging to a file stopped working correctly because it was expecting a 
dictionary for the msg but was always receiving a string.  (I have since made 
it smarter).

The fix for this ticket makes sense when you don't have a guarantee of being 
able to unpickle the msg on the receiving end, but it also limits some of the 
adaptability to pass objects using the SocketHandler.

Some possible improvements:
1. Add a flag to SocketHandler on whether or not it should force the msg to a 
string
2. If it's it a built-in picklable type, don't force to string, else force msg 
to string

Suggestion 2 has some drawbacks in that you'd have to loop over lists, 
dictionaries, etc to verify everything inside there is also picklable.  Also it 
would prevent you from sending custom objects across.

----------
nosy: +Nathan Jensen

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14436>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to