Menu

invalid literal (converting times?)

Help
Anonymous
2004-07-28
2012-09-19
  • Anonymous

    Anonymous - 2004-07-28

    Hello,

    I'm stumped. I get the error:

    ValueError: invalid literal for int(): 7-

    This only happens on one machine using python2.2 and MySQLdb 0.9.1 or using python2.3 and MySQLdb 1.0.0 -- MySQL vers 4.0.20

    On another machine it works with python2.3 and MySQLdb 0.9.2., MySQL vers 4.0.18

    mxDateTime 2.0 on both systems.

    I'm guessing it's parsing a time string from the db to turn it into a DateTime object and is getting '7-' instead of '07' for the month part. But I have no idea what to do about it. Can anyone help?

    (Same queries work in PHP from phpMyAdmin)

    Thanks,

    daw
    Edit/Delete Message

     
    • Andy Dustman

      Andy Dustman - 2004-09-07

      It sounds more like you really have MySQL-4.1 or newer (perhaps only on the server side), which changes the timestamp format to be the same as datetime. MySQLdb-1.1.2 returns it correctly.

       

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.