PostgreSQL connection close when using model with a OneToOneField and a ManyToManyField
|Reported by:||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||yes|
I'm attaching models and tests files that raise unclear errors with r4610 (which is still the case with r5788), but raise straightforward errors with r4609. If you run the test code from within a Python shell, you'll see that at first clear error messages are given, but after a couple of errors the PostgreSQL connection is closed and you get
InterfaceError: connection already closed. When run as a doctest, the InterfaceError occurs before the straightforward error message is ever displayed.
This bug report is about the PostgreSQL connection close. This is the simplest models file that I was able to cause the error with.
I'm using psycopg2 2.0.6, PostgreSQL 8.2, Python 2.5, and Windows XP.