From:
[email protected]
On 14/08/2004 Matthias Urlichs wrote:
Not on my system; it works flawlessly here. What's happening with yours?
the sitecompile fails at postinst.
Anyway, here's my updated patch; I noticed that the "filter()" sub-calls
are superfluous.
sorry, but your updated patch doesn't work: jonas@resivo:~/devel/python-mysqldb/python-mysqldb-1.0.0$ patch -p1 < ../patch.diff
patching file debian/patches/02_allow_stringified_timestamps.dpatch
Reversed (or previously applied) patch detected! Assume -R? [n] y
Hunk #2 FAILED at 22.
1 out of 2 hunks FAILED -- saving rejects to file debian/patches/02_allow_stringified_timestamps.dpatch.rej
additionally, please attach the patch in future, as it's much easier to
use it this way.
sorry, i don't know what you or I messed up, but the patch doesn't work.
...dpatch.rej attached.
bye
jonas
***************
*** 22,39 ****
@DPATCH@
--- python-mysqldb-1.0.0.orig/MySQLdb/times.py
+++ python-mysqldb-1.0.0/MySQLdb/times.py
- @@ -26,8 +26,11 @@
def mysql_timestamp_converter(s):
"""Convert a MySQL TIMESTAMP to a Timestamp object."""
- s = s + "0"*(14-len(s)) # padding
- parts = map(int, filter(None, (s[:4],s[4:6],s[6:8],
- s[8:10],s[10:12],s[12:14])))
- + if s[4] == '-': ## MySQL 4.1: 2004-01-23 12:34:56
+ s = s + "0"*(19-len(s)) # padding, in case we see only a date
- + parts = map(int, (s[:4],s[5:7],s[8:10], s[11:13],s[14:16],s[17:19])) - + else: ## MySQL << 4.1: 20040123123456
+ s = s + "0"*(14-len(s)) # padding
- + parts = map(int, (s[:4],s[4:6],s[6:8], s[8:10],s[10:12],s[12:14]))
try: return apply(Timestamp, tuple(parts))
except: return None
--- 22,41 ----
@DPATCH@
--- python-mysqldb-1.0.0.orig/MySQLdb/times.py
+++ python-mysqldb-1.0.0/MySQLdb/times.py
+ @@ -26,8 +26,13 @@
def mysql_timestamp_converter(s):
"""Convert a MySQL TIMESTAMP to a Timestamp object."""
- s = s + "0"*(14-len(s)) # padding
- parts = map(int, filter(None, (s[:4],s[4:6],s[6:8],
- s[8:10],s[10:12],s[12:14])))
+ + if s[4] == '-': ## MySQL 4.1
+ s = s + "0"*(19-len(s)) # padding, in case we see only a date
+ + parts = map(int, filter(None, (s[:4],s[5:7],s[8:10],
+ + s[11:13],s[14:16],s[17:19])))
+ + else:
+ s = s + "0"*(14-len(s)) # padding
+ + parts = map(int, filter(None, (s[:4],s[4:6],s[6:8],
+ + s[8:10],s[10:12],s[12:14])))
try: return apply(Timestamp, tuple(parts))
except: return None
--- SoupGate-Win32 v1.05
* Origin: you cannot sedate... all the things you hate (1