Opened 13 years ago

Closed 12 years ago

#17047 closed Bug (fixed)

django.db.utils.load_backend gives confusing error for unqualified db backend name

Reported by: Carl Meyer Owned by: Jonas Obrist
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

If someone upgrades to trunk/1.4, missed the deprecation warnings, and still has e.g. "sqlite3" for a database ENGINE setting, the error message they get is a completely opaque "ImportError: no module named base"

load_backend goes to some lengths to give a helpful error message in the case of a totally bogus backend, but oddly in the case of a backend that is not fully-qualified but does exist, it bails with the comment "this must be an error in Django itself." That comment/code is just wrong - it would be easy to add a helpful error message for this case.

Attachments (1)

17047.patch (5.3 KB ) - added by Jonas Obrist 12 years ago.
patch and tests

Download all attachments as: .zip

Change History (4)

comment:1 by Jonas Obrist, 12 years ago

Owner: changed from nobody to Jonas Obrist

by Jonas Obrist, 12 years ago

Attachment: 17047.patch added

patch and tests

comment:2 by Jonas Obrist, 12 years ago

Easy pickings: set
Has patch: set

comment:3 by Jannis Leidel, 12 years ago

Resolution: fixed
Status: newclosed

In [17274]:

Fixed #17047 -- Improved django.db.utils.load_backend to raise a better exception when using a unqualified database backend name. Thanks, Jonas Obrist.

Note: See TracTickets for help on using tickets.
Back to Top