Ticket #15 (closed defect: fixed)

Opened 17 months ago

Last modified 12 months ago

Default charset should be set on database connection

Reported by: wijnand Owned by: wijnand
Priority: trivial Milestone: gozerbot version 0.8
Component: core Version: hg
Keywords: db mysql charset Cc:

Description

There is no default collation/charset specified with the database connection, which may result in conflicting expectations.

Patch:

--- a/gozerbot/db.py   2007-08-31 09:41:42.000000000 +0200
+++ b/gozerbot/db.py   2007-09-01 21:56:07.000000000 +0200
@@ -46,7 +46,7 @@
             import MySQLdb
             self.connection = MySQLdb.connect(db=self.dbname, \
 host=self.dbhost, user=self.dbuser, passwd=self.dbpasswd, \
-connect_timeout=self.timeout)
+connect_timeout=self.timeout, charset='utf8')
         elif self.dbtype == 'sqlite':
             import sqlite
             self.connection = sqlite.connect(datadir + os.sep + self.dbname)

Change History

Changed 17 months ago by wijnand

  • owner changed from bart to wijnand

Changed 17 months ago by wijnand

  • status changed from new to assigned

Changed 12 months ago by bart

  • status changed from assigned to closed
  • resolution set to fixed

fixed in 0.8

Note: See TracTickets for help on using tickets.