[issue10180] File objects should not pickleable

2010-11-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed in r86220. I won't backport it since it would risk breaking existing code, although relying on this is really a bug in itself. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed

[issue10180] File objects should not pickleable

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou 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

[issue10180] File objects should not pickleable

2010-10-23 Thread Georg Brandl
Georg Brandl added the comment: What would be the use case for that? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue10180] File objects should not pickleable

2010-10-23 Thread Alex
Alex 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. -- nosy: +alex ___ Python tracker ___

[issue10180] File objects should not pickleable

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The patch modifies _io.TextIOWrapper, but not _pyio.TextIOWrapper. Is > there a reason? Yes, two of them: - modifying _pyio.Buffered* is enough to trigger the TypeError - _pyio.StringIO inherits from TextIOWrapper, and it must be pickleable -- _

[issue10180] File objects should not pickleable

2010-10-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The patch modifies _io.TextIOWrapper, but not _pyio.TextIOWrapper. Is there a reason? -- ___ Python tracker ___

[issue10180] File objects should not pickleable

2010-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch, but issue10173 must probably be fixed first. -- dependencies: +Don't pickle TestCase instances in test_multiprocessing keywords: +patch Added file: http://bugs.python.org/file19344/pickleio.patch ___

[issue10180] File objects should not pickleable

2010-10-23 Thread Georg Brandl
Georg Brandl added the comment: Sounds like a good idea to me. -- nosy: +georg.brandl ___ Python tracker ___ ___ Python-bugs-list mai

[issue10180] File objects should not pickleable

2010-10-23 Thread Antoine Pitrou
New submission from Antoine Pitrou : In Python 3, pickle accepts to serialize a file object, but the result is nonsensical when unpickled. I think we should explicitly forbid pickling of FileIO, Buffered{Reader,Writer} and TextIOWrapper objects. -- components: IO, Library (Lib) message