Index: /pykota/trunk/pykota/storages/mysqlstorage.py
===================================================================
--- /pykota/trunk/pykota/storages/mysqlstorage.py (revision 3413)
+++ /pykota/trunk/pykota/storages/mysqlstorage.py (revision 3419)
@@ -44,10 +44,23 @@
             port = 3306           # Use the default MySQL port
 
-        self.tool.logdebug("Trying to open database (host=%s, port=%s, dbname=%s, user=%s)..." % (host, port, dbname, user))
+        self.tool.logdebug("Trying to open database (host=%s, port=%s, dbname=%s, user=%s)..." \
+                               % (repr(host),
+                                  repr(port),
+                                  repr(dbname),
+                                  repr(user)))
         try :
-            self.database = MySQLdb.connect(host=host, port=port, db=dbname, user=user, passwd=passwd, charset="utf8")
+            self.database = MySQLdb.connect(host=host,
+                                            port=port,
+                                            db=dbname,
+                                            user=user,
+                                            passwd=passwd,
+                                            charset="utf8")
         except TypeError :
             self.tool.logdebug("'charset' argument not allowed with this version of python-mysqldb, retrying without...")
-            self.database = MySQLdb.connect(host=host, port=port, db=dbname, user=user, passwd=passwd)
+            self.database = MySQLdb.connect(host=host,
+                                            port=port,
+                                            db=dbname,
+                                            user=user,
+                                            passwd=passwd)
 
         try :
@@ -59,5 +72,9 @@
         self.cursor.execute("SET TRANSACTION ISOLATION LEVEL READ COMMITTED;") # Same as PostgreSQL and Oracle's default
         self.closed = False
-        self.tool.logdebug("Database opened (host=%s, port=%s, dbname=%s, user=%s)" % (host, port, dbname, user))
+        self.tool.logdebug("Database opened (host=%s, port=%s, dbname=%s, user=%s)" \
+                               % (repr(host),
+                                  repr(port),
+                                  repr(dbname),
+                                  repr(user)))
         try :
             # Here we try to select a string (an &eacute;) which is
Index: /pykota/trunk/pykota/storages/pgstorage.py
===================================================================
--- /pykota/trunk/pykota/storages/pgstorage.py (revision 3413)
+++ /pykota/trunk/pykota/storages/pgstorage.py (revision 3419)
@@ -53,16 +53,26 @@
             port = 5432         # Use PostgreSQL's default tcp/ip port (5432).
 
-        self.tool.logdebug("Trying to open database (host=%s, port=%s, dbname=%s, user=%s)..." % (host, port, dbname, user))
+        self.tool.logdebug("Trying to open database (host=%s, port=%s, dbname=%s, user=%s)..." % (repr(host),
+                                                                                                  repr(port),
+                                                                                                  repr(dbname),
+                                                                                                  repr(user)))
         try :
-            self.database = pg.connect(host=host, port=port, dbname=dbname, user=user, passwd=passwd)
+            self.database = pg.connect(host=host,
+                                       port=port,
+                                       dbname=dbname,
+                                       user=user,
+                                       passwd=passwd)
         except PGError, msg :
             msg = "%(msg)s --- the most probable cause of your problem is that PostgreSQL is down, or doesn't accept incoming connections because you didn't configure it as explained in PyKota's documentation." % locals()
             raise PGError, msg
-        self.closed = 0
+        self.closed = False
         try :
             self.database.query("SET CLIENT_ENCODING TO 'UTF-8';")
         except PGError, msg :
             self.tool.logdebug("Impossible to set database client encoding to UTF-8 : %s" % msg)
-        self.tool.logdebug("Database opened (host=%s, port=%s, dbname=%s, user=%s)" % (host, port, dbname, user))
+        self.tool.logdebug("Database opened (host=%s, port=%s, dbname=%s, user=%s)" % (repr(host),
+                                                                                       repr(port),
+                                                                                       repr(dbname),
+                                                                                       repr(user)))
 
     def close(self) :
@@ -70,5 +80,5 @@
         if not self.closed :
             self.database.close()
-            self.closed = 1
+            self.closed = True
             self.tool.logdebug("Database closed.")
 
Index: /pykota/trunk/pykota/storages/ldapstorage.py
===================================================================
--- /pykota/trunk/pykota/storages/ldapstorage.py (revision 3413)
+++ /pykota/trunk/pykota/storages/ldapstorage.py (revision 3419)
@@ -76,5 +76,8 @@
         for tryit in range(3) :
             try :
-                self.tool.logdebug("Trying to open database (host=%s, dbname=%s, user=%s)..." % (self.savedhost, self.saveddbname, self.saveduser))
+                self.tool.logdebug("Trying to open database (host=%s, dbname=%s, user=%s)..." \
+                                       % (repr(self.savedhost),
+                                          repr(self.saveddbname),
+                                          repr(self.saveduser)))
                 self.database = ldap.initialize(self.savedhost)
                 if self.info["ldaptls"] :
@@ -91,5 +94,6 @@
                 time.sleep(2)
             except ldap.LDAPError :
-                message = "Unable to connect to LDAP server %s as %s." % (self.savedhost, self.saveduser)
+                message = "Unable to connect to LDAP server %s as %s." \
+                    % (repr(self.savedhost), repr(self.saveduser))
                 self.tool.printInfo("%s" % message, "error")
                 self.tool.printInfo("Trying again in 2 seconds...", "warn")
@@ -100,6 +104,9 @@
                     self.tool.logdebug("Low-Level LDAP Caching enabled.")
                     self.ldapcache = {} # low-level cache specific to LDAP backend
-                self.closed = 0
-                self.tool.logdebug("Database opened (host=%s, dbname=%s, user=%s)" % (self.savedhost, self.saveddbname, self.saveduser))
+                self.closed = False
+                self.tool.logdebug("Database opened (host=%s, dbname=%s, user=%s)" \
+                                       % (repr(self.savedhost),
+                                          repr(self.saveddbname),
+                                          repr(self.saveduser)))
                 return # All is fine here.
         raise PyKotaStorageError, message
@@ -109,5 +116,5 @@
         if not self.closed :
             self.database.unbind_s()
-            self.closed = 1
+            self.closed = True
             self.tool.logdebug("Database closed.")
 
Index: /pykota/trunk/pykota/storages/sqlitestorage.py
===================================================================
--- /pykota/trunk/pykota/storages/sqlitestorage.py (revision 3413)
+++ /pykota/trunk/pykota/storages/sqlitestorage.py (revision 3419)
@@ -39,9 +39,9 @@
         BaseStorage.__init__(self, pykotatool)
 
-        self.tool.logdebug("Trying to open database (dbname=%s)..." % dbname)
+        self.tool.logdebug("Trying to open database (dbname=%s)..." % repr(dbname))
         self.database = sqlite.connect(dbname, isolation_level=None)
         self.cursor = self.database.cursor()
-        self.closed = 0
-        self.tool.logdebug("Database opened (dbname=%s)" % dbname)
+        self.closed = False
+        self.tool.logdebug("Database opened (dbname=%s)" % repr(dbname))
 
     def close(self) :
@@ -50,5 +50,5 @@
             self.cursor.close()
             self.database.close()
-            self.closed = 1
+            self.closed = True
             self.tool.logdebug("Database closed.")
 
