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 ethan.furman
Recipients alexandre.vassalotti, ethan.furman, pitrou
Date 2014-02-06.21:25:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391721950.3.0.401090497621.issue20534@psf.upfronthosting.co.za>
In-reply-to
Content
enum34, the Enum backport, specifically uses `protocol=HIGHEST_PROTOCOL`, while the current enum tests just use the default.

Running the enum34 test expose an issue with pickle protocol 4:

======================================================================
ERROR: test_subclasses_with_getnewargs (__main__.TestEnum)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_enum.py", line 1022, in test_subclasses_with_getnewargs
    self.assertEqual(loads(dumps(NI5, protocol=HIGHEST_PROTOCOL)), 5)
_pickle.PicklingError: Can't pickle <class '__main__.TestEnum.test_subclasses_with_getnewargs.<locals>.NamedInt'>: attribute lookup TestEnum.test_subclasses_with_getnewargs.<locals>.NamedInt on __main__ failed

======================================================================
ERROR: test_tuple_subclass (__main__.TestEnum)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_enum.py", line 1100, in test_tuple_subclass
    self.assertTrue(loads(dumps(SomeTuple.first, protocol=HIGHEST_PROTOCOL)) is SomeTuple.first)
_pickle.PicklingError: Can't pickle <enum 'SomeTuple'>: attribute lookup TestEnum.test_tuple_subclass.<locals>.SomeTuple on __main__ failed
History
Date User Action Args
2014-02-06 21:25:50ethan.furmansetrecipients: + ethan.furman, pitrou, alexandre.vassalotti
2014-02-06 21:25:50ethan.furmansetmessageid: <1391721950.3.0.401090497621.issue20534@psf.upfronthosting.co.za>
2014-02-06 21:25:50ethan.furmanlinkissue20534 messages
2014-02-06 21:25:49ethan.furmancreate