Opened 16 years ago
Closed 13 years ago
#8238 closed Uncategorized (fixed)
django/db/__init__.py assumes it is loaded from the filesystem
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | bhuztez@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There is code in the django.db package init.py that lists the available db backends. Unfortunately this code uses os.listdir() on a directory derived from file, and when loaded from a zip archive, this doesn't work. I have a quick hack that works around this, but perhaps there's a better way.
Attachments (2)
Change History (9)
by , 16 years ago
comment:1 by , 16 years ago
milestone: | → 1.0 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 16 years ago
The ticket is marked as 1.0. Not 1.0-beta. We addressed those first. It's still open. We'll get to it. :-)
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [8424]) Fixed #8238 -- If an invalid database backend is mentioned in settings and the
environment doesn't support os.listdir(), we crashed whilst trying to construct
the friendly error message. This was not so friendly.
This patch handles that case (which occurs in real life in Google App Engine).
Patch from Guido van Rossum.
comment:6 by , 13 years ago
Cc: | added |
---|---|
Easy pickings: | unset |
Resolution: | fixed |
Severity: | → Normal |
Status: | closed → reopened |
Type: | → Uncategorized |
UI/UX: | unset |
The load-backend-pep-302 patch use pkgutil.iter_modules
instead of os.listdir
to solve this.
comment:7 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Thanks for the contribution. Please don't reopen closed for bugs reported and fixed a long time ago with the intention of proposing new features, even when the topics are tightly related. It pollutes ticket history and overall bug tracker stats (e.g. lifetime of tickets)
Open a new ticket for that.
patch