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 Eric Cousineau
Recipients Eric Cousineau, eric.smith, ethan.furman
Date 2021-10-21.18:32:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634841141.1.0.422900220835.issue45546@roundup.psfhosted.org>
In-reply-to
Content
> I get an error with 3.8.10, but not on the main branch (3.11) [...]

Confirmed, using 3.11.0a1 (using Docker). Seems like at least the pickling is fixed?

> I'm confused -- your initial report talks about pickling fields, but your tests are pickling the entire class... what am I missing?

Sorry about that; the original file, `enum_test.py`, was just trying to pickle an enum field, i.e. `DoesNotWork.a`. However, because it uses the type `DoesNotWork.NestedValue2`, `pickle` tries to unpackage that type, but cannot access it via name because `DoesNotWork.NestedValue2` is wrapped as an enum *field*, rather than just a normal field.

I've uploaded a new file, `enum_nested_type_test.py`, that perhaps shows the root cause - the `Enum` interprets the nested class as an enum field (wrapping it as an enum value), rather than as "just" a nested class. In contrast, it did not seem to wrap the function.

Does that make sense / help at all?
History
Date User Action Args
2021-10-21 18:32:21Eric Cousineausetrecipients: + Eric Cousineau, eric.smith, ethan.furman
2021-10-21 18:32:21Eric Cousineausetmessageid: <1634841141.1.0.422900220835.issue45546@roundup.psfhosted.org>
2021-10-21 18:32:21Eric Cousineaulinkissue45546 messages
2021-10-21 18:32:21Eric Cousineaucreate