dbapi.py
changeset 8992 55a1567d92a0
parent 8934 48a6e6b88b16
parent 8983 2a244f90a1e3
child 9016 0368b94921ed
child 9255 46f41c3e1443
child 9297 9a44436cd5a5
--- a/dbapi.py	Thu May 23 17:32:56 2013 +0200
+++ b/dbapi.py	Wed May 29 16:44:16 2013 +0200
@@ -213,9 +213,13 @@
         elif cnxprops and cnxprops.cnxtype == 'inmemory':
             database = 'inmemory://' + database
         else:
-            database = 'pyro://%s/%s.%s' % (kwargs.pop('host', ''),
-                                            kwargs.pop('group', 'cubicweb'),
-                                            database)
+            host = kwargs.pop('host', None)
+            if host is None:
+                host = ''
+            group = kwargs.pop('group', None)
+            if group is None:
+                group = 'cubicweb'
+            database = 'pyro://%s/%s.%s' % (host, group, database)
     puri = urlparse(database)
     method = puri.scheme.lower()
     if method == 'inmemory':