#13 Bug when dealing with date and datetime columns

MySQLdb
closed
Andy Dustman
MySQLdb (53)
5
2012-09-19
2003-11-04
Sadruddin Rejeb
No

Index: pytimes.py

====================
RCS file: /cvsroot/mysql-python/MySQLdb/MySQLdb/pytimes.py,
v
retrieving revision 1.1
diff -u -r1.1 pytimes.py
--- pytimes.py 11 Jul 2003 00:07:06 -0000 1.1
+++ pytimes.py 4 Nov 2003 08:55:23 -0000
@@ -38,7 +38,7 @@

 try:
     d, t = s.split(sep, 1)
  • return apply(datetime, tuple(d.split('-')+t.split(':')))
  • return apply(datetime, map(int, tuple(d.split('-')+t.split(':'))
    ))
    except:
    return None

@@ -53,5 +53,5 @@
return None

def Date_or_None(s):
- try: return apply(date, tuple(s.split('-',2)))
+ try: return apply(date, map(int, tuple(s.split('-',2))))
except: return None

Discussion

  • Andy Dustman
    Andy Dustman
    2003-11-24

    Logged In: YES
    user_id=71372

    Fixed in CVS