VirtualMailManager/handler.py
branchv0.7.x
changeset 649 08837f3fbced
parent 648 9cf2cf762e26
child 653 cf07e4468934
equal deleted inserted replaced
648:9cf2cf762e26 649:08837f3fbced
   198                         port=self._cfg.dget('database.port'),
   198                         port=self._cfg.dget('database.port'),
   199                         database=self._cfg.dget('database.name'),
   199                         database=self._cfg.dget('database.name'),
   200                         user=self._cfg.pget('database.user'),
   200                         user=self._cfg.pget('database.user'),
   201                         password=self._cfg.pget('database.pass'))
   201                         password=self._cfg.pget('database.pass'))
   202                 self._dbh.set_client_encoding('utf8')
   202                 self._dbh.set_client_encoding('utf8')
   203                 _db_mod.extensions.register_type(_db_mod.extensions.UNICODE)
       
   204                 dbc = self._dbh.cursor()
   203                 dbc = self._dbh.cursor()
   205                 dbc.execute("SET NAMES 'UTF8'")
   204                 dbc.execute("SET NAMES 'UTF8'")
   206                 dbc.close()
   205                 dbc.close()
   207             except _db_mod.DatabaseError as err:
   206             except _db_mod.DatabaseError as err:
   208                 raise VMMError(str(err), DATABASE_ERROR)
   207                 raise VMMError(str(err), DATABASE_ERROR)