cannot pickle classes created by make_enum

Bug #734789 reported by Alexandre PIGNÉ
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flufl.enum
Won't Fix
Low
Barry Warsaw

Bug Description

Pickle refuses to pickle & unpickle make_enum returned classes.

Error:
PicklingError: Can't pickle <Fruit2 {kiwi: 1, banana: 2, tomato: 3}>: it's not found as flufl.enum._
enum.Fruit2

Revision history for this message
Alexandre PIGNÉ (bloodaille) wrote :

Use the module scope of the previous frame to attach the generated object

Barry Warsaw (barry)
Changed in flufl.enum:
status: New → Triaged
importance: Undecided → Low
Barry Warsaw (barry)
Changed in flufl.enum:
assignee: nobody → Barry Warsaw (barry)
milestone: none → 3.3
status: Triaged → Confirmed
Revision history for this message
Barry Warsaw (barry) wrote :

The patch seems rather nasty. I think I won't fix this, since you should probably use the class syntax if you want to pickle it.

Changed in flufl.enum:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.