Menu

mxDateTime Causing Problems

Help
Ken Kinder
2001-06-18
2012-09-19
  • Ken Kinder

    Ken Kinder - 2001-06-18

    I have mxDateTime installed for good reasons, and like the idea of queries coming back with mxDateTime objects, but there is a problem. When I have a date in MySQL with a value like '0000-00-00' (which MySQL accepts), I get an exception when trying to run a query:

    _mysql.ProgrammingError: Query failed [('month out of range (1-12):
    0',)]:
    select * from tr_prod_attr_ch where prod_attr_id = 45 order by
    choice_order_mysql.ProgrammingError: Query failed

    Any thoughts on that?

     
    • Andy Dustman

      Andy Dustman - 2001-06-18

      My main thought is: What version of MySQLdb are you using? 0.9.0 should return illegal dates as None. You could also override the default type converter if you have an earlier version.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.