Serhiy Storchaka added the comment:
Thanks Ethan.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20680
___
___
Python-bugs-list mailing list
Ethan Furman added the comment:
Enum members that are replacing constants now pickle by name (see issue23673).
--
resolution: - duplicate
stage: patch review - resolved
status: open - closed
superseder: - IntEnum is unpicklable by previous Python versions
Ethan Furman added the comment:
Serhiy, sorry for taking so long to get back to this -- we spent so much time
making sure pickling worked I had no idea that unpickling didn't work in prior
versions.
--
___
Python tracker rep...@bugs.python.org
Ethan Furman added the comment:
An IntEnum is just a fancy int. You can add them, subtract them, multiply
them, all that kind of thing.
If you attempt to unpickle a 3.4 _PickleByNameIntEnum on a 3.3 system, what's
going to happen?
--
___
Python
Serhiy Storchaka added the comment:
If you attempt to unpickle a 3.4 _PickleByNameIntEnum on a 3.3 system,
what's going to happen?
The same as if you attempt to unpickle a 3.4 IntEnum on a 3.3 system --
AttributeError.
--
___
Python tracker
Serhiy Storchaka added the comment:
For the socket module constants there is even better way, which supports
forward compatibility, i.e. SOCK_STREAM pickled in 3.5 could be unpickled on
3.3 (replacing ints with enums breaks forward compatibility). Here is a patch.
--
Added file:
Serhiy Storchaka added the comment:
I don't see how it can break code. If people use workaround that were not
broken by changing SOCK_STREAM from int to enum, it shouldn't break by changing
pickle representation of SOCK_STREAM.
--
___
Python
Ethan Furman added the comment:
To make sure I understand correctly:
On platform ABC the value 1 could mean SOCK_STREAM but on platform XYZ
SOCK_STREAM is value 32?
Assuming the need to pickle socket types is not new, then people have been
doing it, possibly with painful workarounds, on the
Changes by Ethan Furman et...@stoneleaf.us:
--
assignee: - ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20680
___
___
New submission from Serhiy Storchaka:
As far as socked enums are platform depending, pickling them by value makes not
much sense. Here is a patch which makes AddressFamily and SocketType members be
pickled by name.
--
components: Library (Lib)
files: socket_enums_pickle_by_name.patch
10 matches
Mail list logo