id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,branch,changelog,apichanges,internalchanges 10287,TypeError: unsupported type for timedelta microseconds component: unicode,btimby@…,,"I have a new installation of Trac 0.12. I am using MySQLdb 1.2.3. {{{ 2011-07-25 21:47:28,034 Trac[main] ERROR: Internal Server Error: Traceback (most recent call last): File ""/usr/lib/python2.6/site-packages/trac/web/main.py"", line 513, in _dispatch_request dispatcher.dispatch(req) File ""/usr/lib/python2.6/site-packages/trac/web/main.py"", line 235, in dispatch resp = chosen_handler.process_request(req) File ""/usr/lib/python2.6/site-packages/trac/wiki/web_ui.py"", line 117, in process_request page = WikiPage(self.env, pagename) File ""/usr/lib/python2.6/site-packages/trac/wiki/model.py"", line 44, in __init__ self._fetch(name, version, db) File ""/usr/lib/python2.6/site-packages/trac/wiki/model.py"", line 72, in _fetch self.time = from_utimestamp(time) File ""/usr/lib/python2.6/site-packages/trac/util/datefmt.py"", line 84, in from_utimestamp return _epoc + timedelta(microseconds=ts or 0) TypeError: unsupported type for timedelta microseconds component: unicode }}} When loading for the first time, I receive the above in the trac log file. I was able to fix this by simply changing the from_utimestamp function: {{{ def from_utimestamp(ts): """"""Return the `datetime` for the given microsecond POSIX timestamp."""""" return _epoc + timedelta(microseconds=long(ts) or 0) }}} I am not sure why the time column of the wiki table comes back from MySQLdb as unicode type, but coercing it to a long seems to work properly for me.",defect,closed,normal,,general,0.12,normal,worksforme,mysql needinfo,,,,,