Opened 4 years ago
Closed 4 years ago
#32705 closed Cleanup/optimization (fixed)
Database cache.delete uses cursor after it is closed
Reported by: | ecogels | Owned by: | ecogels |
---|---|---|---|
Component: | Core (Cache system) | Version: | 3.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
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.
Change History (4)
comment:1 by , 4 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 4 years ago
Description: | modified (diff) |
---|
comment:3 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Accepted → Ready for checkin |
comment:4 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
In a0a5e0f4: