durusmail: quixote-users: Strange NoneType errors
Strange NoneType errors
2004-07-02
2004-07-02
2004-07-02
Strange NoneType errors
Andy Todd
2004-07-02
I'm seeing an unexpected error when I take my Quixote application (which
is working fine on my Debian box) and run it on my Macintosh.

I've narrowed down the problem to a nice simple cause, and hopefully
someone can point out what may be causing my pain, or suggest a better
alternative.

I have written a module to handle all of my database interaction (called
rather unimaginatively database.py). I import this in each of my PTL
modules. My first meaningful PTL module (site.ptl) in turn imports a
number of others so that they can be included in it's _q_exports list.

When these subsidiary modules are imported I see this error message;

"""
TypeError: 'NoneType' object is not callable
"""

The statement which triggers this is the __init__ method of my Database
class in my database.py module. This does not cause any problems on my
Debian box. Nor does it raise any errors when I start an interactive
session and type the following;

 >>> import database
 >>> db1 = database.Database()
 >>> db2 = database.Database()

Which is pretty much what is happening in my pages. To prove this I've
knocked up a really simple PTL module which triggers the same error;

"""
import database

db1 = database.Database()
db2 = database.Database()

_q_index [html] (request):
     '
My test page
\n' '

A little light text

' """ When I access this page I trigger the same error as my other pages. The database I'm using is Gadfly (http://gadfly.sourceforge.net/) my Debian box is running testing (the Python 2.3.4, Apache 1.3.29 and Quixote 0.6.1). The Macintosh is running Panther (OSX 10.3) and Python 2.3.0, Apache 1.3.29 and Quixote 1.0c1 All access is via cgi. Thanks in advance for any help, Andy -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/
reply