django/django — pull request #1509 by mgorny (2013-08-23 16:04:04+00:00)
Title: Properly check signature of authenticate(), and don't hide TypeErrors.

The current auth backend code catches TypeError to detect backends that
do not support specified arguments. As a result, any TypeErrors raised
within the actual backend code are silenced.

In Python 2.7+ and 3.2+ this could be avoided through using
inspect.getcallargs(). With this method, we can test whether arguments
match the signature without actually calling the function, and therefore
distinguish real TypeErrors.

Fixes: https://code.djangoproject.com/ticket/18171

I will link this PR to the issue as soon as I get my activation e-mail.