From andy47 at halfcooked.com Wed Feb 9 12:46:13 2005 From: andy47 at halfcooked.com (Andy Todd) Date: Wed Feb 9 12:46:38 2005 Subject: [DB-SIG] [Fwd: Can't find MySQLdb for Python 2.4] Message-ID: <4209F805.8080407@halfcooked.com> Forwarding this to the list ... -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ -------------- next part -------------- An embedded message was scrubbed... From: "Anthra Norell" Subject: Can't find MySQLdb for Python 2.4 Date: Wed, 9 Feb 2005 11:53:32 +0100 Size: 4322 Url: http://mail.python.org/pipermail/db-sig/attachments/20050209/10b77981/CantfindMySQLdbforPython2.mht From farcepest at gmail.com Thu Feb 10 04:06:30 2005 From: farcepest at gmail.com (Andy Dustman) Date: Thu Feb 10 04:06:33 2005 Subject: [DB-SIG] [Fwd: Can't find MySQLdb for Python 2.4] In-Reply-To: <4209F805.8080407@halfcooked.com> References: <4209F805.8080407@halfcooked.com> Message-ID: <9826f380050209190629500ce7@mail.gmail.com> On Wed, 09 Feb 2005 22:46:13 +1100, Andy Todd wrote: > Forwarding this to the list ... But... why? Not the right place for it... This is: http://sourceforge.net/forum/forum.php?forum_id=70461 > > ---------- Forwarded message ---------- > From: "Anthra Norell" > To: > Date: Wed, 9 Feb 2005 11:53:32 +0100 > Subject: Can't find MySQLdb for Python 2.4 > > I updated Python from 2.22 to 2.4 and need to update the MySQL interface, because the old one doesn't work anymore. Hopping links starting at the DB-SIG page, I was directed to MySQL-python-1.2.0.tar.gz from Source Forge. It's the only option offered. Plus the platform specification says 'all'. > Now the contents of this archive seems to be incomplete. It doesn't contain the basic module MySQLdb. After a couple of hours of hunting I've been everywhere about five times without catching sight of anything resembling what I'm looking for and am now completely on my knees. No. The tarball is just fine. The MD5 should be b0eb974cc3c917276e015275e1ec996f. If it isn't, maybe the mirror has an incomplete copy. I had problems with a couple of the .us mirrors, but found one that workd. I hope this guy at least read README and knows he needs a compiler... But then, his complaint doesn't even say what platform he is using. That just drives me nuts. -- Computer interfaces should never be made of meat. Using GMail? Setting Reply-to address to <> disables this annoying feature. From anthra.norell at tiscalinet.ch Mon Feb 14 14:44:24 2005 From: anthra.norell at tiscalinet.ch (Anthra Norell) Date: Mon Feb 14 14:46:45 2005 Subject: [DB-SIG] How deal with new datetime type breaking old colde? Message-ID: <002f01c5129b$4c136ee0$0201a8c0@mcuf7> Hi, Since I upgraded to Python 2.4 all my 'select ... date ... from ...' commands to MySQL seem to return this format: "datetime.date ('2005', '01'. '01')" when my routines expect: "2005-01-01" Consequently, I get errors no end like this one: TypeError: unsupported operand type(s) for -: 'int' and 'datetime.date' Any idea anyone how to fix this problem at the root rather than scratching every itch for some considerable time to come and cluttering my programs with hacks in the process? Is there a configuration setting somewhere? Thanks Frederic -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20050214/4a4b3e29/attachment.htm From farcepest at gmail.com Mon Feb 14 16:50:03 2005 From: farcepest at gmail.com (Andy Dustman) Date: Mon Feb 14 16:50:13 2005 Subject: [DB-SIG] How deal with new datetime type breaking old colde? In-Reply-To: <002f01c5129b$4c136ee0$0201a8c0@mcuf7> References: <002f01c5129b$4c136ee0$0201a8c0@mcuf7> Message-ID: <9826f38005021407503a057304@mail.gmail.com> On Mon, 14 Feb 2005 14:44:24 +0100, Anthra Norell wrote: > Since I upgraded to Python 2.4 all my 'select ... date ... from ...' > commands to MySQL seem to return this format: > > "datetime.date ('2005', '01'. '01')" > > when my routines expect: > > "2005-01-01" MySQLdb uses the Python built-in datetime when it is available. If you don't like this: db = MySQLdb.connect(...) from MySQLdb.constants import FIELD_TYPE del db.converter[FIELD_TYPE.DATETIME] del db.converter[FIELD_TYPE.DATE] del db.converter[FIELD_TYPE.TIMESTAMP] del db.converter[FIELD_TYPE.TIME] There are other variations on how to do this (like deleting the values from the MySQLdb.converters.conversions, or making a custom conversions and passing it to connect() via the conv parameter), but by deleting the converter, you'll get the column as a string. Or you could update your code. If you are doing any parsing of the date at all, why not just use the datetime object? http://docs.python.org/lib/module-datetime.html -- Computer interfaces should never be made of meat. Using GMail? Setting Reply-to address to <> disables this annoying feature.