[New-bugs-announce] [issue33138] Improve standard error for uncopyable types

Serhiy Storchaka report at bugs.python.org
Sun Mar 25 12:21:38 EDT 2018


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

Currently most extension types are not pickleable and copyable. The default error messages is "can't pickle XXX objects". This is confusing in case of copying because not all know that copying falls back to the pickle protocol (see for example issue33023). The proposed PR changes the default error messages to more neutral "cannot serialize 'XXX' object". This or similar error messages are already used in some classes (files, sockets, compressors/decompressors).

It also removes __getstate__ methods raising an error from non-pickleable extension types. They where added when extension types were pickleable by default (fixed in issue22995). Now they are not needed.

----------
components: Interpreter Core
messages: 314418
nosy: alexandre.vassalotti, christian.heimes, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve standard error for uncopyable types
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33138>
_______________________________________


More information about the New-bugs-announce mailing list