mxDateTime in Python2.2 on Tru64
M.-A. Lemburg
mal at lemburg.com
Thu Feb 21 12:12:32 EST 2002
Richard Papworth wrote:
>
> Hi
>
> After upgrading from Python 1.52 I'm having trouble getting mx
> Extensions to work with Python 2.2.
>
> Compilation went OK (although config.h was missing from the Python
> includes directory). However, when I try to load up the DateTime
> module I run into problems:
>
> Python 2.2 (#2, Feb 20 2002, 11:44:40)
> [GCC 2.95 19990728 (release)] on osf1V4
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from mx import DateTime
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "/nfs3/users/postgres/usr/local/lib/python2.2/site-packages/mx/DateTime/__init__.py",
> line 8, in ?
> from DateTime import *
> File "/nfs3/users/postgres/usr/local/lib/python2.2/site-packages/mx/DateTime/DateTime.py",
> line 441, in ?
> MaxDateTime = DateTime(sys.maxint / 366 - 1,12,31)
> OverflowError: signed integer is greater than maximum
> >>>
>
> The other mx extensions seem to be OK. Does anyone know what's going
> wrong?
Are you using the latest version ?
If not, here's the fix...
DateTime.py:
# Limits (see also the range checks in mxDateTime.c)
MaxDateTime = DateTime(5867440,12,31)
MinDateTime = DateTime(-5851455,1,1)
MaxDateTimeDelta = DateTimeDeltaFromSeconds(2147483647 * 86400.0)
MinDateTimeDelta = -MaxDateTimeDelta
Note that there is an eGenix User Mailing list for these sort
of things:
http://lists.egenix.com/mailman/listinfo/
--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting: http://www.egenix.com/
Python Software: http://www.egenix.com/files/python/
More information about the Python-list
mailing list