From: Atli T. <at...@ga...> - 2004-05-28 12:03:43
|
Yet again I shoot to soon... forgot to look through the archives before posting, missed the bit about the segfault fixed in cvs, my apologies. Atli. -----Original Message----- From: Atli Thorbjornsson [mailto:at...@ga...] Sent: 28. mai 2004 11:32 To: Patrick K. O'Brien Cc: pyd...@li... Subject: Segmentation fault Hi again, I keep getting segfaults whenever I try to retrieve a timestamp in pydb2 without first converting it to a string via char(). I realise one should probably always cast first anyway but I have a lot of inexperienced python programmers working under my supervision and segfaults are rather scary. Shouldn't this either work or just be caught in an exception printing something informative out instead of the timestamp? Example: import DB2 conn = DB2.connect() curs = conn.cursor() curs.execute("select intime from hra where intime > current timestamp - dec(120000,6)" one_row = curs.fetchone() print one_row[0] curs.close() del curs conn.close() del conn intime is a timestamp in table hra. This segfaults in pydb2 on (curs.fetchone()) but obviously runs fine on command line. If you point me in the right direction I might even be able to do it for you ;) Atli Thorbjornsson. |