Your message dated Wed, 12 Oct 2005 15:06:32 +1000
with message-id <[EMAIL PROTECTED]>
and subject line Closing python-pgsql time handling bug
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--------------------------------------
Received: (at submit) by bugs.debian.org; 15 Jul 2005 10:00:07 +0000
>From [EMAIL PROTECTED] Fri Jul 15 03:00:07 2005
Return-path: <[EMAIL PROTECTED]>
Received: from warsl404pip7.highway.telekom.at (email.aon.at) [195.3.96.91]
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1DtMzG-0003BW-00; Fri, 15 Jul 2005 03:00:07 -0700
Received: (qmail 30512 invoked from network); 15 Jul 2005 09:59:34 -0000
Received: from m673p011.adsl.highway.telekom.at (HELO localhost.localdomain)
([62.47.244.11])
(envelope-sender <[EMAIL PROTECTED]>)
by smarthub76.highway.telekom.at (qmail-ldap-1.03) with SMTP
for <[EMAIL PROTECTED]>; 15 Jul 2005 09:59:34 -0000
Received: by localhost.localdomain (sSMTP sendmail emulation); Fri, 15 Jul 2005
11:59:32 +0200
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Johannes Vetter <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: python-pgsql: handling of fractional seconds does not work properly
X-Mailer: reportbug 3.12
Date: Fri, 15 Jul 2005 11:59:32 +0200
Message-Id: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE
autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level:
Package: python-pgsql
Version: 2.4.0-5
Severity: normal
Tags: patch
String representation of a mx.DateTime value having a fractional second
contains a ',' (comma) if this is the locale's decimal separator.
An SQL statement containing such a timestamp always fails.
Another problem is, that the fractional seconds are cut off after the second
digit (due to str () implementation of mx.DateTime). This renders a timestamp
column with a default-value of 'NOW ()' unusable since the read value
always differ from what will be issued in an update statement.
For mx.DateTimeDelta values with fractional seconds the fractional part
is completely dropped. This renders time columns unusable since the
value will be changed in the backend (silently).
The following patch should solve these problems.
--- PgSQL-org.py 2005-07-15 10:44:13.494271208 +0200
+++ PgSQL.py 2005-07-15 11:40:33.595417728 +0200
@@ -2254,7 +2254,8 @@
elif hasattr(value, '_quote'):
return value._quote()
elif type(value) is DateTimeType:
- return "'%s'" % value
+ return "'%04d-%02d-%02d %02d:%02d:%09.6f'" % (value.year, value.month,
+ value.day, value.hour, value.minute, value.second)
elif type(value) is DateTimeDeltaType:
return "'%s'" % dateTimeDelta2Interval(value)
elif isinstance(value, StringType):
@@ -2294,18 +2295,11 @@
"""
if type(interval) is DateTimeDeltaType:
- s = str(interval)
- ago = ''
- if s[0] == '-':
- ago = ' ago'
- s = s[1:]
- else:
- ago = ''
- s = s.split(':')
- if len(s) < 4:
- return '%s:%s:%s %s' % (s[0], s[1], s[2], ago)
-
- return '%s days %s:%s:%s %s' % (s[0], s[1], s[2], s[3], ago)
+ return ("%s %02d:%02d:%09.6f%s" % ( \
+ interval.day and '%d days' % abs (interval.day) or '',
+ abs (interval.hour),
+ abs (interval.minute), abs (interval.second),
+ interval.day < 0 and ' ago' or '')).strip ()
else:
raise TypeException, "DateTimeDelta2Interval requires a DataTimeDelta."
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.4.27abi-0.1
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)
Versions of packages python-pgsql depends on:
ii python 2.3.5-2 An interactive high-level object-o
ii python2.3-pgsql 2.4.0-5 A Python DB-API 2.0 interface to P
-- no debconf information
---------------------------------------
Received: (at 318404-done) by bugs.debian.org; 12 Oct 2005 05:07:19 +0000
>From [EMAIL PROTECTED] Tue Oct 11 22:07:19 2005
Return-path: <[EMAIL PROTECTED]>
Received: from vscan02.westnet.com.au [203.10.1.132]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1EPYpj-0005rx-00; Tue, 11 Oct 2005 22:07:19 -0700
Received: from localhost (localhost.localdomain [127.0.0.1])
by localhost (Postfix) with ESMTP id D68E511989E
for <[EMAIL PROTECTED]>; Wed, 12 Oct 2005 13:06:47 +0800 (WST)
Received: from vscan02.westnet.com.au ([127.0.0.1])
by localhost (vscan02.westnet.com.au [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 31095-01 for <[EMAIL PROTECTED]>;
Wed, 12 Oct 2005 13:06:47 +0800 (WST)
Received: from localhost.localdomain (dsl-202-173-183-137.vic.westnet.com.au
[202.173.183.137])
(using TLSv1 with cipher AES256-SHA (256/256 bits))
(No client certificate requested)
by vscan02.westnet.com.au (Postfix) with ESMTP id 864BB11A901
for <[EMAIL PROTECTED]>; Wed, 12 Oct 2005 13:06:46 +0800 (WST)
Received: from bab by localhost.localdomain with local (Exim 4.50)
id 1EPYoz-00014C-27
for [EMAIL PROTECTED]; Wed, 12 Oct 2005 15:06:33 +1000
Date: Wed, 12 Oct 2005 15:06:32 +1000
From: Ben Burton <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Closing python-pgsql time handling bug
Message-ID: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.9i
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2005_01_02
Hi,
As reported by Mathias Klose, this is a bug in egenix-mx-base which was
fixed about a month ago (#325903).
I'm closing this bug accordingly.
Ben.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]