Opened 17 years ago

Closed 17 years ago

#5161 closed (fixed)

mysql backend repeatedly adds warnings filter

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

Description

See /trunk/django/db/backends/mysql/base.py, 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 17 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by Malcolm Tredinnick, 17 years ago

Triage Stage: UnreviewedAccepted

by durdinator, 17 years ago

Attachment: patch_5161.diff added

comment:2 by durdinator, 17 years ago

Has patch: set

comment:3 by Adrian Holovaty, 17 years ago

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