Mailing List Archive

[issue41052] Opt out serialization/deserialization for heap type
Dong-hee Na <donghee.na92@gmail.com> added the comment:

> It would be better to fix copyreg._reduce_ex() instead of disabling pickling for these types one by one

I agree :)

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue41052>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue41052] Opt out serialization/deserialization for heap type [ In reply to ]
Antoine Pitrou <pitrou@free.fr> added the comment:

At some point, pickle protocols 0 and 1 should be deprecated and slated for removal. Protocol 2 is 17 years ago already, and protocol 3 has become the default in Python 3.

That would probably be a better use of contributor time than trying to make heap types compatible with those obsolete protocols.

----------
nosy: +pitrou

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue41052>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue41052] Opt out serialization/deserialization for heap type [ In reply to ]
Change by Serhiy Storchaka <storchaka+cpython@gmail.com>:


----------
pull_requests: +21812
pull_request: https://github.com/python/cpython/pull/22870

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue41052>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue41052] Opt out serialization/deserialization for heap type [ In reply to ]
Serhiy Storchaka <storchaka+cpython@gmail.com> added the comment:

I came to the same conclusion after trying to fix it. But we cannot just do it now. We have to fix bugs in Python 3.9 and support protocols 0 and 1 for some deprecation period.

Also protocols 0 and 1 are used in some third-party implementations for other programming languages, so they can be used for interoperability with other languages.

The proposed patch adds additional check. It uses the fact that the __new__ attribute for classes implemented in C is a bultin function with __self__ pointing to this class (it is created in tp_new_wrapper()).

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue41052>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue41052] Opt out serialization/deserialization for heap type [ In reply to ]
Serhiy Storchaka <storchaka+cpython@gmail.com> added the comment:


New changeset 8cd1dbae32d9303caac3a473d3332f17bc98c921 by Serhiy Storchaka in branch 'master':
bpo-41052: Fix pickling heap types implemented in C with protocols 0 and 1 (GH-22870)
https://github.com/python/cpython/commit/8cd1dbae32d9303caac3a473d3332f17bc98c921


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue41052>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue41052] Opt out serialization/deserialization for heap type [ In reply to ]
Change by Serhiy Storchaka <storchaka+cpython@gmail.com>:


----------
pull_requests: +21880
pull_request: https://github.com/python/cpython/pull/22963

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue41052>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue41052] Opt out serialization/deserialization for heap type [ In reply to ]
Serhiy Storchaka <storchaka+cpython@gmail.com> added the comment:


New changeset 0aaecb30483e98fc29c1f4253967d05da092f0c5 by Serhiy Storchaka in branch '3.9':
[3.9] bpo-41052: Fix pickling heap types implemented in C with protocols 0 and 1 (GH-22870). (GH-22963)
https://github.com/python/cpython/commit/0aaecb30483e98fc29c1f4253967d05da092f0c5


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue41052>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue41052] Opt out serialization/deserialization for heap type [ In reply to ]
Change by Serhiy Storchaka <storchaka+cpython@gmail.com>:


----------
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue41052>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue41052] Opt out serialization/deserialization for heap type [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

Thanks for the fix Serhiy!

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue41052>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com