classification
Title: Make io.BytesIO and io.StringIO picklable.
Type: enhancement Stage: resolved
Components: IO, Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: accepted
Dependencies: 6241 Superseder:
Assigned To: Nosy List: alexandre.vassalotti, benjamin.peterson, pitrou
Priority: normal Keywords: patch

Created on 2009-06-06 02:21 by alexandre.vassalotti, last changed 2009-07-22 03:25 by alexandre.vassalotti. This issue is now closed.

Files
File name Uploaded Description Edit
pickle_support_for_memoryio.diff alexandre.vassalotti, 2009-06-06 02:21
pickle_support_for_memoryio-2.diff alexandre.vassalotti, 2009-06-08 20:18
Messages (4)
msg88987 - (view) Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) Date: 2009-06-06 02:21
Here is a patch to add pickling support to io.BytesIO and io.StringIO.
Although they are non-trivial, the additions were made with a fair
amount of care (and love!) and thus I believe they could be included in
3.1. 

Furthermore, the improved test-suite uncovered a number of bugs in the
implementation of io.StringIO. So the patch also fixes:

  * fixes a memory-leak in stringio_dealloc; 
  * disallows bytes-like object from being used as the newline
    argument of StringIO;
  * and changes the exception raised by StringIO.__init__ to a
    TypeError when initial_value is not a str.
msg88998 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-06-06 11:19
I think it's too late for 3.1, since it's a new feature.
msg89108 - (view) Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) Date: 2009-06-08 20:18
I split the bug fixes in the patch into two separate issues. It looks
like pickling support for io.StringIO and io.BytesIO will have to wait
for 3.2.
msg90797 - (view) Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) Date: 2009-07-22 03:25
Committed in r74158 (branches/py3k).
History
Date User Action Args
2009-07-22 03:25:03alexandre.vassalottisetstatus: open -> closed
messages: + msg90797

keywords: patch, patch
resolution: accepted
stage: patch review -> resolved
2009-06-08 20:18:10alexandre.vassalottisetkeywords: patch, patch
files: + pickle_support_for_memoryio-2.diff
dependencies: + Better type checking for the arguments of io.StringIO
messages: + msg89108
2009-06-06 11:19:17pitrousetversions: - Python 3.1
nosy: + pitrou, benjamin.peterson

messages: + msg88998

keywords: patch, patch
2009-06-06 02:21:12alexandre.vassalotticreate