[issue10180] File objects should not pickleable

Antoine Pitrou report at bugs.python.org
Sat Oct 23 23:11:23 CEST 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

> I don't see why Buffered or TextIO's shouldn't be pickleable, ISTM
> their pickleability should be based on what the underlying file obj
> is.

That could be. Right now, though, pickling them gives nonsensical
results and I think it would be better to give an explicit error
message.

(a problem with making them pickleable is that, by exposing details of
the internal structure in the pickle, you're limiting what
implementation changes you can do in the future)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10180>
_______________________________________


More information about the Python-bugs-list mailing list