[dbapi] Fix broken inmemory:// URLs parsing (closes #3225832) stable
authorRémi Cardona <remi.cardona@logilab.fr>
Thu, 17 Oct 2013 10:30:35 +0200
branchstable
changeset 9297 9a44436cd5a5
parent 9282 1709dd30387c
child 9298 eff262f5ec3f
[dbapi] Fix broken inmemory:// URLs parsing (closes #3225832) ParseResult.path is what comes after the "domain name" in standard URLs. So in the case of 'inmemory://<instance' URLs, it is always empty. ParseResult.netloc contains the "domain name" part that we really want.
dbapi.py
--- a/dbapi.py	Thu Oct 10 13:16:54 2013 +0200
+++ b/dbapi.py	Thu Oct 17 10:30:35 2013 +0200
@@ -223,7 +223,7 @@
     puri = urlparse(database)
     method = puri.scheme.lower()
     if method == 'inmemory':
-        config = cwconfig.instance_configuration(puri.path)
+        config = cwconfig.instance_configuration(puri.netloc)
     else:
         config = cwconfig.CubicWebNoAppConfiguration()
     repo = get_repository(database, config=config)