This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gregory.p.smith
Recipients gregory.p.smith, serhiy.storchaka
Date 2021-04-27.00:33:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619483582.32.0.0403635127136.issue43946@roundup.psfhosted.org>
In-reply-to
Content
The changes from https://bugs.python.org/issue29368 are causing a subclass of list trouble:

```
class FieldList(list):
    ...
    def extend(...): ...
```

FieldList has its own extend and append methods that implement additional checks.  As it is a list subclass, the new `PyList_CheckExact()` from the afformentioned issue's https://github.com/python/cpython/commit/f89fdc29937139b55dd68587759cadb8468d0190 where it used to be a `PyList_Check()` in 3.6 and earlier is causing the unpickling code to call the instance `.extend()` method instead of internally using `PyList_SetSlice()` at the C level.

Calling .extend() naturally fails at this point as __setstate__ hasn't yet been called so the FieldList instance is uninitialized.

Here's the code in question https://github.com/google/protorpc/blob/master/protorpc/messages.py#L1126

It used it work.  3.7 broke it.  What was unpicklable is now not.

To work around this logic would be needed in the extend (and append) methods to check if they're being called on an uninitialized instance.  That seems unreasonable.

_[credit to my colleague Richard L. for the diagnosis]_
History
Date User Action Args
2021-04-27 00:33:02gregory.p.smithsetrecipients: + gregory.p.smith, serhiy.storchaka
2021-04-27 00:33:02gregory.p.smithsetmessageid: <1619483582.32.0.0403635127136.issue43946@roundup.psfhosted.org>
2021-04-27 00:33:02gregory.p.smithlinkissue43946 messages
2021-04-27 00:33:01gregory.p.smithcreate