Sometimes, the MySQLdb module does not support the MySQL server version. In this example, it is MySQLdb 1.0 with MySQL 4.1. Essentially, this is a configuration error as one should use the correct module version for the database. Unfortunately, one of the best known Linux "enterprise" distributions (Redhat Enterprise Linux 4) does ship with a broken configuration (see Bug 155341 in the Redhat Bugtracker).
Especially the changed format of timestamps may cause problems such as the exception message: "ValueError?: invalid literal for int()". This error is widely seen on systems with the configuration above (see MySQLdb-Bugtracker, report on the Python mailinglist). Fortunately, the error is easily fixable by providing an own converter (see Ben Last's posting).
Currently it is not possible to provide a custom converter without modifying TurboGears. In this ticket, I look for the best way to implement this in TurboGears. I like to see an algorithm which only adds the needed workaround if a connection to an MySQL database is made, the version of the MySQLdb module is below/equal 1.0 and a special configuration option (e.g. "enable_mysql41_timestamp_workaround") is true (defaults to False).
Note that this addition is not meant to be a permanent part of TurboGears. Maybe it is better to produce a kind of contributed patch which people can add to their TurboGears installation.
This ticket is used to discuss several implementation strategies.