Opened 8 years ago

Closed 7 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:

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 7 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 8 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Changed 7 years ago by durdinator

comment:2 Changed 7 years ago by durdinator

  • Has patch set

comment:3 Changed 7 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(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