Hi,
I have a bit of a problem with my connection string in db.py - 
specifically, the database password has a '@' symbol, and so web2py chokes 
because it assumes this is the delimiter between password and host.

I had a look at dal.py and I guess the regex needs modifying to take this 
case into account. Unfortunately my regex skills are pretty rudimentary - I 
spent an hour or so trying to nut it out, but didn't get anywhere, so I 
thought I'd ask you guys. The code is around line 1800 of dal.py:

        uri = uri.split('://')[1]
        m = 
re.compile('^(?P<user>[^:@]+)(\:(?P<password>[^@]*))?@(?P<host>[^\:@/]+)(\:(?P<port>[0-9]+))?/(?P<db>[^\?]+)(\?sslmode=(?P<sslmode>.+))?$').match(uri)
        if not m:
            raise SyntaxError, "Invalid URI string in DAL"

I can see what it's doing and where it's going wrong, just not how to fix 
it :(

Any help is appreciated.. I guess the easy option is to change the DB 
password, but unfortunately that isn't an option for me.

Cheers,
Hugh.

Reply via email to