[issue22890] StringIO.StringIO pickled in 2.7 is not unpickleable on 3.x

2016-06-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is the _compat_pickle module that purposed to support backward and 
forward compatibility for renamed or moved classes and modules.

StringIO.StringIO in 2.x corresponds to io.StringIO or io.BytesIO. The problem 
is that we can't determine what of classes is a match in every concrete case, 
especially if StringIO.StringIO is empty.

But since cStringIO.StringIO is not pickleable either, I now think that it is 
not worth to support to support compatibility with pickled StringIO.StringIO 
instances.

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22890] StringIO.StringIO pickled in 2.7 is not unpickleable on 3.x

2016-06-02 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22890] StringIO.StringIO pickled in 2.7 is not unpickleable on 3.x

2016-06-02 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

Unless I'm missing something, StringIO doesn't exist as a module in Python 3, 
as mentioned in 
https://docs.python.org/3.0/whatsnew/3.0.html#text-vs-data-instead-of-unicode-vs-8-bit.

If you're trying to unpickle in 3.x an object pickled by 2.7.x, I'm not sure 
there is a guarantee that unpickling works for objects in modules that were 
renamed between 2.x and 3.x. This also doesn't work if you pickle a 
ConfigParser in 2.7 and unpickle it in 3.x.

--
nosy: +Jelle Zijlstra

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22890] StringIO.StringIO pickled in 2.7 is not unpickleable on 3.x

2015-02-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The issue is about StringIO.StringIO, not io.StringIO.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22890
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22890] StringIO.StringIO pickled in 2.7 is not unpickleable on 3.x

2015-02-27 Thread Mark Lawrence

Mark Lawrence added the comment:

Seems fine on Windows 8.1

c:\Users\Mark\Documents\MyPythonc:\cpython\PCbuild\amd64\python.exe
Python 3.5.0a1+ (default:344d57c521b9+, Feb 27 2015, 13:39:56) [MSC v.1800 64 
bit (AMD64)] on win32
Type help, copyright, credits or license for more information.
 import pickle, io
 pickle.dumps(io.StringIO('abc'), 2)
b'\x80\x02c_io\nStringIO\nq\x00)\x81q\x01(X\x03\x00\x00\x00abcq\x02X\x01\x00\x00\x00\nq\x03K\x00Ntq\x04b.'
 pickle.loads(b'\x80\x02c_io\nStringIO\nq\x00)\x81q\x01(X\x03\x00\x00\x00abcq\x02X\x01\x00\x00\x00\nq\x03K\x00Ntq\x04b.')
_io.StringIO object at 0x004C6E604288


--
nosy: +BreamoreBoy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22890
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22890] StringIO.StringIO pickled in 2.7 is not unpickleable on 3.x

2014-11-16 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

StringIO.StringIO is pickleable and unpickleable on 2.7 but is not unpickleable 
on 3.x.

Python 2.7:
 import pickle, StringIO
 pickle.dumps(StringIO.StringIO('abc'), 2)
'\x80\x02(cStringIO\nStringIO\nq\x00oq\x01}q\x02(U\tsoftspaceq\x03K\x00U\x07buflistq\x04]q\x05U\x03posq\x06K\x00U\x03lenq\x07K\x03U\x06closedq\x08\x89U\x03bufq\tU\x03abcq\nub.'
 pickle.loads(b'\x80\x02(cStringIO\nStringIO\nq\x00oq\x01}q\x02(U\tsoftspaceq\x03K\x00U\x07buflistq\x04]q\x05U\x03posq\x06K\x00U\x03lenq\x07K\x03U\x06closedq\x08\x89U\x03bufq\tU\x03abcq\nub.')
StringIO.StringIO instance at 0xb70c122c

On 3.x I got an error:
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: _io.StringIO.__setstate__ argument should be 4-tuple, got dict

--
components: Library (Lib)
messages: 231268
nosy: alexandre.vassalotti, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: StringIO.StringIO pickled in 2.7 is not unpickleable on 3.x
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22890
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com