mxDateTime in Python2.2 on Tru64

John Machin sjmachin at lexicon.net
Thu Feb 21 15:56:55 EST 2002


richard.papworth at bbsrc.ac.uk (Richard Papworth) wrote in message news:<695dd93e.0202210758.3b64f79a at posting.google.com>...
> 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:

[snip]
 
>   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?

Here's a *temporary* patch: change the offending line to be:

MaxDateTime = DateTime(5867440,12,31)
# magic number is result of sys.maxint / 366 - 1 on a 32-bit machine

This should keep you going for a little while ...

Hope I don't go down in history as the cause of the Y5867.44K bug.

Cheers,
John



More information about the Python-list mailing list