mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
Issue #6218: Make io.BytesIO and io.StringIO picklable.
This commit is contained in:
parent
d2bb18b281
commit
cf76e1ac92
5 changed files with 410 additions and 16 deletions
|
@ -765,6 +765,11 @@ class BytesIO(BufferedIOBase):
|
|||
self._buffer = buf
|
||||
self._pos = 0
|
||||
|
||||
def __getstate__(self):
|
||||
if self.closed:
|
||||
raise ValueError("__getstate__ on closed file")
|
||||
return self.__dict__.copy()
|
||||
|
||||
def getvalue(self):
|
||||
"""Return the bytes value (contents) of the buffer
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue