[Django] #20841: NotImplementedErrors should provide exception messages

5 views
Skip to first unread message

Django

unread,
Aug 1, 2013, 10:26:08 AM8/1/13
to django-...@googlegroups.com
#20841: NotImplementedErrors should provide exception messages
--------------------------------------+---------------------------------
Reporter: joseph@… | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: 1.5
Severity: Normal | Keywords: NotImplementedError
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+---------------------------------
The Django source has many occurrences of NotImplementedErrors raised
without a message. For example, if a dev creates a class inheriting from
contrib.admin.SimpleListFilter and does not provide a lookups() method,
all they see from the Debug template is "NotImplementedError at
/path/to/file/ No exception supplied". This, in my opinion, makes seeking
help difficult for those not comfortable enough to dig through the Django
source. A simple message such as "instances of SimpleListFilter must
provide a lookups() method" provides instant feedback and a non-ambiguous
means to seeking help if needed.

In short, my request is to have all NotImplementedError exceptions raised
accompanied by a message.

I realize this change would be boring to work on, so I am more than
willing to read through the patch procedures and submit a patch myself if
you all find this a worthy cause. (The nature of this request may even be
simple enough to send through Github)

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

Django

unread,
Aug 16, 2013, 2:52:12 AM8/16/13
to django-...@googlegroups.com
#20841: NotImplementedErrors should provide exception messages
--------------------------------------+------------------------------------

Reporter: joseph@… | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: NotImplementedError | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* needs_better_patch: => 0
* component: Uncategorized => Core (Other)
* needs_tests: => 0
* version: 1.5 => master
* needs_docs: => 0
* stage: Unreviewed => Accepted


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

Django

unread,
Sep 6, 2013, 12:31:21 PM9/6/13
to django-...@googlegroups.com
#20841: NotImplementedErrors should provide exception messages
-------------------------------------+-------------------------------------
Reporter: joseph@… | Owner:
Type: | TimClifford
Cleanup/optimization | Status: assigned

Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: NotImplementedError | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by TimClifford):

* status: new => assigned
* owner: nobody => TimClifford


Comment:

Looks like gruntwork that requires a base level of code literacy, which is
perfect to assign during a sprint.[[BR]]
[[BR]]
I'm on it!

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

Django

unread,
Sep 6, 2013, 5:55:42 PM9/6/13
to django-...@googlegroups.com
#20841: NotImplementedErrors should provide exception messages
-------------------------------------+-------------------------------------
Reporter: joseph@… | Owner:
Type: | TimClifford
Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: NotImplementedError | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by TimClifford):

Pull request submitted and awaiting review. 92 instances of "raise
NotImplementedError" used to placehold base class methods for subclassing
were given verbose may/must subclass explanations, and two instances of
not-implemented features were written up as well (found in
/utils/datetime.py line #67 and /utils/regex_helper.py line #95).

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

Django

unread,
Sep 6, 2013, 6:17:27 PM9/6/13
to django-...@googlegroups.com
#20841: NotImplementedErrors should provide exception messages
-------------------------------------+-------------------------------------
Reporter: joseph@… | Owner:
Type: | TimClifford
Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: NotImplementedError | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by TimClifford):

* has_patch: 0 => 1


Comment:

Added a patch in the form of a Pull Request, visible here:
https://github.com/django/django/pull/1569

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

Django

unread,
Sep 10, 2013, 11:10:23 AM9/10/13
to django-...@googlegroups.com
#20841: NotImplementedErrors should provide exception messages
-------------------------------------+-------------------------------------
Reporter: joseph@… | Owner:
Type: | TimClifford
Cleanup/optimization | Status: closed

Component: Core (Other) | Version: master
Severity: Normal | Resolution: fixed

Keywords: NotImplementedError | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b2b763448f726ee952743596e9a34fcb154bdb12"]:
{{{
#!CommitTicketReference repository=""
revision="b2b763448f726ee952743596e9a34fcb154bdb12"
Fixed #20841 -- Added messages to NotImplementedErrors

Thanks joseph at vertstudios.com for the suggestion.
}}}

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

Reply all
Reply to author
Forward
0 new messages