From: Mike Bayer Date: Mon, 10 Jul 2006 21:33:03 +0000 (+0000) Subject: adjument to regexp for parsing courtesy Barry Warsaw X-Git-Tag: rel_0_2_6~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=55edd4ce95a0bd2f92482474b866debb3a29b3cf;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git adjument to regexp for parsing courtesy Barry Warsaw --- diff --git a/lib/sqlalchemy/engine/url.py b/lib/sqlalchemy/engine/url.py index 65c9f16627..bd8ee26436 100644 --- a/lib/sqlalchemy/engine/url.py +++ b/lib/sqlalchemy/engine/url.py @@ -60,8 +60,8 @@ def _parse_rfc1738_args(name): pattern = re.compile(r''' (\w+):// (?: - ([^:]*) - (?::(.*))? + ([^:/]*) + (?::([^/]*))? @)? (?: ([^/:]*) diff --git a/test/engine/parseconnect.py b/test/engine/parseconnect.py index 43389c272c..cb77d96d0d 100644 --- a/test/engine/parseconnect.py +++ b/test/engine/parseconnect.py @@ -20,11 +20,16 @@ class ParseConnectTest(PersistTest): 'dbtype:///E:/work/src/LEM/db/hello.db', 'dbtype:///E:/work/src/LEM/db/hello.db?foo=bar&hoho=lala', 'dbtype://', - 'dbtype://username:password@/db' + 'dbtype://username:password@/db', + 'dbtype:////usr/local/mailman/lists/_xtest@example.com/members.db' ): u = url.make_url(text) print u, text print "username=", u.username, "password=", u.password, "database=", u.database, "host=", u.host + assert u.drivername == 'dbtype' + assert u.username == 'username' or u.username is None + assert u.password == 'password' or u.password is None + assert u.host == 'hostspec' or u.host == '127.0.0.1' or (not u.host) assert str(u) == text