From the DB API 2.0 spec: "The cursor will be unusable from this point
forward" https://www.python.org/dev/peps/pep-0249/#Cursor.close
As the main backend drivers don't mind it I suppose that is is open to
interpretation.
Here is a basic PR
https://github.com/django/django/compare/main...ecogels:fix-dbcache-
delete-1
--
Ticket URL: <https://code.djangoproject.com/ticket/32705>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/32705#comment:1>
Old description:
> The return bool(cursor.rowcount) is outside of the with block, so the
> cursor will have been closed at that point.
>
> From the DB API 2.0 spec: "The cursor will be unusable from this point
> forward" https://www.python.org/dev/peps/pep-0249/#Cursor.close
>
> As the main backend drivers don't mind it I suppose that is is open to
> interpretation.
>
> Here is a basic PR
> https://github.com/django/django/compare/main...ecogels:fix-dbcache-
> delete-1
New description:
The return bool(cursor.rowcount) is outside of the with block, so the
cursor will have been closed at that point.
From the DB API 2.0 spec: "The cursor will be unusable from this point
forward" https://www.python.org/dev/peps/pep-0249/#Cursor.close
As the main backend drivers don't mind it I suppose that is is open to
interpretation.
PR https://github.com/django/django/pull/14341
--
--
Ticket URL: <https://code.djangoproject.com/ticket/32705#comment:2>
* owner: nobody => ecogels
* status: new => assigned
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/32705#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"a0a5e0f4c83acdfc6eab69754e245354689c7185" a0a5e0f4]:
{{{
#!CommitTicketReference repository=""
revision="a0a5e0f4c83acdfc6eab69754e245354689c7185"
Fixed #32705 -- Prevented database cache backend from checking .rowcount
on closed cursor.
Co-authored-by: Mariusz Felisiak <felisiak...@gmail.com>
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32705#comment:4>