When python struggles: Attribute Errors

Bengt Richter bokr at oz.net
Tue Dec 17 17:46:57 EST 2002


On 17 Dec 2002 05:22:45 -0800, matt at greenroom.com.au (matt) wrote:

>I have a problem where the code:
>
># ------ begin code ------
>class DBInitializer:
>    def init(self, db_name, host, user="", password=""):
>        # Connect to host
>        if not self.status("Connecting to host: %s..." % host, \
>                           self.connect(host, user, password)):
>            ...
>        self.cursor = self.db.cursor()
>	...
>
>    def connect(self, host, user, password):
>        try:
>            self.db = MySQLdb.connect(host, user, password)
>        ...
># ------ end code ------
>
>raises an Attribute Error.
>
[...]
>Any Ideas?
>
post the exception stack trace that you got ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list