trac-hacks / tracstats

Project and source code statistics plugin for Trac.
http://trac-hacks.org/wiki/TracStatsPlugin
Other
20 stars 13 forks source link

Fix implicit casting from decimal to integer #52

Open MarkWalter94 opened 5 months ago

MarkWalter94 commented 5 months ago

Fixed error with mysql 8.0.36 and trac 1.6 with python 3.10.12 TypeError: 'decimal.Decimal' object cannot be interpreted as an integer

stoecker commented 5 months ago

I don't like that fix much. It makes an already ugly code more ugly. Rather than the casting the time variables in SQL it should be converted to the typical new higher precision trac timing variables everywhere and the SQL then use these everywhere (any only multiply/divide where really necessary).

It's a leftover from older times, where trac stored times in seconds and not micro seconds.

I removed the old trac related code, but didn't want to touch too much at the time I updated for 1.6.