[egenix-users] mx.DateTime and Glibc 2.3
M.-A. Lemburg
mal at lemburg.com
Tue May 13 01:10:04 CEST 2003
Justin Ryan wrote:
> Hello,
>
> I'm having some trouble with mx.DateTime which I beleive is related to
> Glibc v2.3 - however I'm not 100% sure, and would not be able to file a
> relevant bug report against glibc without a bit more information.
>
> Essentially, mx.DateTime is raising an exception with pre-1970 dates
> when trying to access a DateTime object's ticks() method. On other
> systems, a negative integer is returned.
Note that the negative ticks range is mostly undefined,
so this is not really a bug in the C lib. Many systems
do return negative values for dates before 1970, but
some don't and return an error instead (this is what
you see under gibc 2.3).
> I was able to install debian stable (glibc 2.2), and do ssomething like
> the following:
>
> <- snip ->
>
> $ python
> Python 2.2 (#1, Apr 25 2002, 17:44:12)
> [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
>>>>from mx.DateTime import DateTime
>>>>d = DateTime( 1960 )
>>>>print d
>
> 1960-01-01 00:00:00.00
>
>>>>d.ticks()
>
> -315597600.0
>
>
> <- snip ->
>
> I then upgraded my glibc and nothing else, with the following result:
>
> <- snip ->
>
> $ python
> Python 2.2.2 (#1, Jan 18 2003, 10:18:59)
> [GCC 3.2.2 20030109 (Debian prerelease)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
>>>>from mx.DateTime import DateTime
>>>>d = DateTime( 1960 )
>>>>print d
>
> 1960-01-01 00:00:00.00
>
>>>>d.ticks()
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> mx.DateTime.Error: cannot convert value to a time value
>
>
> <- snip ->
>
> Because I am not familiar with the c sources to mxdatetime, it's
> difficult for me to troubleshoot this. Any help is much appreciated -
> even if it is only providing enough information / guidance to file a
> relevant report against glibc.
>
> Thanks in advance,
>
> -Justin
>
> _______________________________________________________________________
> eGenix.com User Mailing List http://www.egenix.com/
> http://lists.egenix.com/mailman/listinfo/egenix-users
--
Marc-Andre Lemburg
eGenix.com
Professional Python Software directly from the Source (#1, May 13 2003)
>>> Python/Zope Products & Consulting ... http://www.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
EuroPython 2003, Charleroi, Belgium: 42 days left
More information about the egenix-users
mailing list