Re: mxDateTime timestamps with locale active

Daniele Varrazzo <[email protected]> Tue, 25 May 2010 11:32:26 +0100
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
On Tue, May 25, 2010 at 7:53 AM, Karsten Hilbert
<[email protected]> wrote:
> Hello,
>
> would anyone be interested in commenting on the below ?
>
> The problem ist that the ISO format does allow for "," and
> "." while PostgreSQL will not handle the "," case. Which is
> why the below code is translating "," to "." when quoting
> mxDateTime instances.

I preferred to avoid comments mostly because I don't know exactly the
problem. I've not used mx.datetimes for ages and never in combination
with timezones. You have presented an implementation, but I don't know
exactly the problem it wanted to solve. For what I've seen fixing one
of the latest bug mx doesn't support timezones, and I've not checked
how timezones are handled by these objects.

If there is a bug, the best thing is to fix it in psycopg, not to add
a customized typecaster. So, can you provide an example where psycopg
does the wrong thing and the expected result?

If you have other of these hacks, it would be nice to have the problem
they address in the psycopg test suite :)

-- Daniele