Serhiy Storchaka added the comment: > I think all we need to do is add a .__reduce__() > method to StreamWriter and StreamReader, which then > raises a PickleError.
Rather TypeError. Yes, it is the least that we should to do in maintained releases. If codecs_stream_delegating_2.patch is considered too drastic for bugfix. But this can be only a part of problem. May be there are issues with other optional special methods. And adding __reduce_ex__ breaks subclass pickleability if it was implemented with __getstate__ and __getnewargs__. Here is a patch for this way. ---------- Added file: http://bugs.python.org/file41217/codecs_stream_forbid_pickling.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6395> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com