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 <>
The changes from 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 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

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]_
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: <>
2021-04-27 00:33:02gregory.p.smithlinkissue43946 messages
2021-04-27 00:33:01gregory.p.smithcreate