[Pythonmac-SIG] Testing sqlite3 on python2.5 More

Samuel M. Smith smithsm at samuelsmith.org
Fri Mar 2 23:49:46 CET 2007


On Mar 2, 2007, at 14:02 , Bob Ippolito wrote:

> On 3/2/07, Samuel M. Smith <smithsm at samuelsmith.org> wrote:
>>
>> I was able to run the example from the python library docs for  
>> pysqlite3
>> I assume that means my sqlite3 installation is good?
>> I would appreciate confirmation from somebody who knows what they are
>> doing.
>>
>
> Python 2.5 ships with a working SQLite binding.
>
> My guess is that Roundup does not support Python 2.5 yet. I'm
> relatively sure that pysqlite's module name got renamed when it was
> included with the standard library.

The module name in python 2.5 is sqlite3

I was able to get roundup to work fine (at least it comes up and I  
can do basic stuff haven't fully tested everything)
using the built in roundup-server with python 2.5 using anydbm  
backend, which on my system looked to be dbm.

The problems came when I tried to change to the sqlite backend. It  
crashes when you first try to hit the web page.


I got the bugs below in case anyone is interested. I have also posted  
to the roundup users list.
But so far no response.

the roundup code seems to imply it works with sqlite3 bindings which  
I believe first appeared in 2.5.

this snippet from roundup's back_sqlite.py

sqlite_version = None
try:
     import sqlite
     sqlite_version = 1
except ImportError:
     try:
         from pysqlite2 import dbapi2 as sqlite
         if sqlite.version_info < (2,1,0):
             raise ValueError('pysqlite2 minimum version is 2.1.0+ '
                 '- %s found'%sqlite.version)
         sqlite_version = 2
     except ImportError:
         import sqlite3 as sqlite
         sqlite_version = 3

Got hung up on the sqlite bugs so haven't had time to try the apache2  
mod_python way of running roundup nor
your suggestion of using a reverse proxy instead of mod_python  
("yikes" never heard of it before, apache2 docs confusing me).



BUG ************************************************************
when browsing to
http://localhost:8917/adeptdev/

get the following error


: unsupported file format
Python 2.5
/Library/Frameworks/Python.framework/Versions/2.5/Resources/ 
Python.app/Contents/MacOS/Python
A problem occurred while running a Python script. Here is the  
sequence of function calls leading up to the error, with the most  
recent (innermost) call first. The exception attributes are:
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- 
packages/roundup/backends/rdbms_common.py in load_dbschema 
(self=<roundlite 0x2040ad0>)
   180         ''' Load the schema definition that the database  
currently implements
   181         '''
   182         self.cursor.execute('select schema from schema')
       self = <roundlite 0x2040ad0>, global cursor = undefined,  
global execute = undefined
   183         schema = self.cursor.fetchone()
   184         if schema:
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- 
packages/roundup/backends/back_sqlite.py in open_connection 
(self=<roundlite 0x2040ad0>)
   120
   121         (self.conn, self.cursor) = self.sql_open_connection()
   122
   123         try:
   124             self.load_dbschema()
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- 
packages/roundup/backends/rdbms_common.py in __init__(self=<roundlite  
0x2040ad0>, config=<roundup.configuration.CoreConfig instance at  
0x14c7468>, journaltag='admin')
   127
   128         # open a connection to the database, creating the  
"conn" attribute
   129         self.open_connection()
       self = <roundlite 0x2040ad0>, global open_connection = undefined
   130
   131     def clearCache(self):
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- 
packages/roundup/instance.py in open(self=<roundup.instance.Tracker  
instance at 0x12fd580>, name='admin')
   100             'Boolean': hyperdb.Boolean,
   101             'Number': hyperdb.Number,
   102             'db': backend.Database(self.config, name)
       backend = <module 'roundup.backends.back_sqlite' from '/Li.../ 
site-packages/roundup/backends/back_sqlite.pyc'>, global Database =  
undefined, self = <roundup.instance.Tracker instance at 0x12fd580>,  
global config = undefined, name = 'admin'
   103         }
   104
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- 
packages/roundup/cgi/client.py in opendb 
(self=<roundup.cgi.client.Client instance at 0x20409e0>,  
username='admin')
   529         # open the database or only set the user
   530         if not hasattr(self, 'db'):
   531             self.db = self.instance.open(username)
       self = <roundup.cgi.client.Client instance at 0x20409e0>,  
global db = undefined, global instance = undefined, global open =  
undefined, username = 'admin'
   532         else:
   533             if self.instance.optimize:
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- 
packages/roundup/cgi/client.py in determine_user 
(self=<roundup.cgi.client.Client instance at 0x20409e0>)
   443     def determine_user(self):
   444         """Determine who the user is"""
   445         self.opendb('admin')
       self = <roundup.cgi.client.Client instance at 0x20409e0>,  
global opendb = undefined
   446
   447         # make sure we have the session Class
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- 
packages/roundup/cgi/client.py in inner_main 
(self=<roundup.cgi.client.Client instance at 0x20409e0>)
   256
   257             # make sure we're identified (even anonymously)
   258             self.determine_user()
       self = <roundup.cgi.client.Client instance at 0x20409e0>,  
global determine_user = undefined
   259
   260             # figure out the context and desired content template





More information about the Pythonmac-SIG mailing list