#9113: Misleading error message if sqlite3 is not installed as exception is
swallowed
---------------------------+------------------------------------------------
 Reporter:  jjackson       |       Owner:  nobody    
   Status:  new            |   Milestone:            
Component:  Uncategorized  |     Version:  1.0       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 This is similar to #1673, which has been fixed. But there is still a case
 when this can happen:

 from root/django/trunk/django/db/backends/sqlite3/base.py


 {{{
 14      try:
 15          try:
 16              from sqlite3 import dbapi2 as Database
 17          except ImportError:
 18              from pysqlite2 import dbapi2 as Database
 19      except ImportError, e:
 20          import sys
 21          from django.core.exceptions import ImproperlyConfigured
 22          if sys.version_info < (2, 5, 0):
 23              module = 'pysqlite2'
 24          else:
 25              module = 'sqlite3'
 26          raise ImproperlyConfigured, "Error loading %s module: %s" %
 (module, e)
 }}}

 If the first import fails, and then the second import fails, you'll get
 this error message: "ImproperlyConfigured: Error loading sqlite3 module:
 No module named pysqlite2" when the error may really be that there was no
 module named sqlite3 available. (That was my particular problem.) The
 'module' variable gets set based on the sys.version, but the exception is
 based on whichever one last failed. There's no pysqlite2 in Python 2.5, so
 if the first import fails under 2.5, you're going to get the misleading
 error message.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9113>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to