Re: mxDateTime timestamps with locale active

Karsten Hilbert <[email protected]> Tue, 25 May 2010 16:57:04 +0200
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
On Tue, May 25, 2010 at 02:43:35PM +0100, Daniele Varrazzo wrote:

> > It seems the problem does not exist with psycopg2 anymore as
> > I cannot make it happen any longer.
> 
> I think the problem was fixed in rev. 2.0.7 [1]. It seems that
> currently psycopg2 doesn't rely on mxDT.ISO at all, but uses its own
> string formatting unaware from the locale. So it appears the
> typecaster is not required anymore. But as said, if you had to take
> special measures to make psycopg work with gnumed, it would be nice to
> know it and consider your workarounds as evidence of problems to be
> fixed.
> 
> [1] https://dndg.it/cgi-bin/gitweb.cgi?p=public/psycopg2.git;a=commitdiff;h=46bf23caf47c3f08194e524312b5afbe0c449b70


Indeed, this patch remove the comment "building the right
ISO string" and proceeds to use

	'%09.6f' % seconds_with_microseconds

which in a quick test does not seem to generate "," even
under de_DE locale (which I would assume it should,
actually).

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346