From 036cdbe7fb2d651ba5fbbc758c8584df011c8043 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 6 Apr 2018 11:39:15 -0400 Subject: Raise informative exception for non-sortable PK An informative exception is re-raised when a primary key value is not sortable in Python during an ORM flush under Python 3, such as an ``Enum`` that has no ``__lt__()`` method; normally Python 3 raises a ``TypeError`` in this case. The flush process sorts persistent objects by primary key in Python so the values must be sortable. Change-Id: Ia186968982dcd1234b82f2e701fefa2a1668a7e4 Fixes: #4232 --- doc/build/changelog/unreleased_13/4232.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 doc/build/changelog/unreleased_13/4232.rst (limited to 'doc') diff --git a/doc/build/changelog/unreleased_13/4232.rst b/doc/build/changelog/unreleased_13/4232.rst new file mode 100644 index 000000000..176650afd --- /dev/null +++ b/doc/build/changelog/unreleased_13/4232.rst @@ -0,0 +1,10 @@ +.. change:: + :tags: bug, orm + :tickets: 4232 + + An informative exception is re-raised when a primary key value is not + sortable in Python during an ORM flush under Python 3, such as an ``Enum`` + that has no ``__lt__()`` method; normally Python 3 raises a ``TypeError`` + in this case. The flush process sorts persistent objects by primary key + in Python so the values must be sortable. + -- cgit v1.2.1