[Django] #20083: Fix for #18985 makes it impossible to filter deprecation warnings

4 views
Skip to first unread message

Django

unread,
Mar 18, 2013, 5:26:21 PM3/18/13
to django-...@googlegroups.com
#20083: Fix for #18985 makes it impossible to filter deprecation warnings
----------------------------------------+------------------------
Reporter: aaugustin | Owner: nobody
Type: Bug | Status: new
Component: Core (Other) | Version: 1.5
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------+------------------------
The following does nothing on Python >= 2.7 because warnings are piped
into logging since [44046e8a]:

{{{
warnings.filterwarnings(
'error',
r'django\.conf\.urls\.defaults is deprecated; use django\.conf\.urls
instead',
DeprecationWarning,
r'django\.conf\.urls\.defaults')
}}}

That's a bit annoying.

--
Ticket URL: <https://code.djangoproject.com/ticket/20083>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 18, 2013, 5:32:06 PM3/18/13
to django-...@googlegroups.com
#20083: Fix for #18985 makes it impossible to filter deprecation warnings
------------------------------+--------------------------------------

Reporter: aaugustin | Owner: nobody
Type: Bug | Status: new
Component: Core (Other) | Version: 1.5
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------

Comment (by epicserve):

I agree. I ran into this same issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/20083#comment:1>

Django

unread,
Mar 18, 2013, 6:20:37 PM3/18/13
to django-...@googlegroups.com
#20083: Fix for #18985 makes it impossible to filter deprecation warnings
------------------------------+------------------------------------

Reporter: aaugustin | Owner: nobody
Type: Bug | Status: new
Component: Core (Other) | Version: 1.5
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by jacob):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/20083#comment:2>

Django

unread,
Feb 10, 2014, 6:56:25 AM2/10/14
to django-...@googlegroups.com
#20083: Fix for #18985 makes it impossible to filter deprecation warnings
------------------------------+------------------------------------

Reporter: aaugustin | Owner: nobody
Type: Bug | Status: new
Component: Core (Other) | Version: 1.5
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by guettli):

* cc: hv@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/20083#comment:3>

Django

unread,
Mar 8, 2014, 5:53:37 AM3/8/14
to django-...@googlegroups.com
#20083: Fix for #18985 makes it impossible to filter deprecation warnings
------------------------------+------------------------------------

Reporter: aaugustin | Owner: nobody
Type: Bug | Status: new
Component: Core (Other) | Version: 1.5
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------

Comment (by Claude Paroz <claude@…>):

In [changeset:"8446a2438ffeab845e31cba4489f03fccc387298"]:
{{{
#!CommitTicketReference repository=""
revision="8446a2438ffeab845e31cba4489f03fccc387298"
Added test about error filterwarnings

Refs #20083.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/20083#comment:4>

Django

unread,
Mar 8, 2014, 5:58:23 AM3/8/14
to django-...@googlegroups.com
#20083: Fix for #18985 makes it impossible to filter deprecation warnings
------------------------------+--------------------------------------
Reporter: aaugustin | Owner: nobody
Type: Bug | Status: closed

Component: Core (Other) | Version: 1.5
Severity: Normal | Resolution: worksforme
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by claudep):

* status: new => closed
* resolution: => worksforme


Comment:

Looking at the source code of the `warnings` module, it seems that raising
the exception precedes the `showwarning` call, hence routing through
logging should not affect `error` filters. I've just added a test for
this. But it may be that recent commits with addition of
`DeprecationWarning` subclasses for Django deprecations has also helped.

--
Ticket URL: <https://code.djangoproject.com/ticket/20083#comment:5>

Reply all
Reply to author
Forward
0 new messages