Opened 11 years ago

Closed 11 years ago

#5161 closed (fixed)

mysql backend repeatedly adds warnings filter

Reported by: adurdin@… Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


See /trunk/django/db/backends/mysql/, line 82 (r5609 at time of writing).

The mysql backend's cursor() method calls warnings.filterwarnings() each time a cursor is requested (if DEBUG==True). Instead, filterwarnings() should only be called once (e.g. at module load), to avoid needlessly adding identical filters to the warnings module's internal list.

Attachments (1)

patch_5161.diff (1.0 KB) - added by durdinator 11 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 11 years ago by Malcolm Tredinnick

Triage Stage: UnreviewedAccepted

Changed 11 years ago by durdinator

Attachment: patch_5161.diff added

comment:2 Changed 11 years ago by durdinator

Has patch: set

comment:3 Changed 11 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [6229]) Fixed #5161 -- Changed MySQL backend only to report warning once. Thanks, durdinator

Note: See TracTickets for help on using tickets.
Back to Top