Trying to get my gvib driver to work, got this dbtest failure:

    def uri(self):
        auth = getattr(self, 'user', None) or ''
        if auth:
E           if self.password:
>           AttributeError: GVIBConnection instance has no attribute 'password'


Indeed, the code looks at self.password.

Now, dbconnection is a base class, but it's not entirely an abstract base class.

So, shouldn't this attribute be initialized in the base class's __init__?

For some reason, it grates me to see base classes access attributes that only subclasses set, without even a hint of their requirement being set in the base class's __init__, either via keywords or static initialization as None.

But I digress.

I copied firebirdconnection code, it and looks like this:

class GVIBConnection(DBAPI):

    def __init__(self, host, db, user='sysdba',
                 dialect=None, role=None, charset=None, **kw):

        self.module = gvib

        self.limit_re = re.compile('^\s*(select )(.*)', re.IGNORECASE) = host
        self.db = db
        self.user = user
        self.passwd = passwd

Here, the subclass sets "passwd", and "passwd" is the keyword that's passed to it.

But other subclass code looks like this:

    def connectionFromURI(cls, uri):
        auth, password, host, port, path, args = cls._parseURI(uri)
        if not password:
            password = 'masterkey'
        if not auth:
        if == 'nt' and path[0] == '/':
            # strip the leading slash off of db name/alias
            path = path[1:]
        path = path.replace('/', os.sep)
        print "args ", args
        return cls(host, db=path, user=auth, passwd=password, **args)

Is there some reason why core code uses "password", but the database driver uses "passwd"?

This seems odd. What is the proper keyword.. passwd, or password?

I see mysql also uses 'passwd' as it's keyword argument.

But it has in it's init

        self.module = MySQLdb = host
        self.port = port
        self.db = db
        self.user = user
        self.password = passwd

So .. I guess it's too late to change the "passwd" keyword for db connections, but is it appropriate to default this attribute to something in the base class, or am I nit-picking?

Brad Clements,          (315)268-1000                         
AOL-IM or SKYPE: BKClements