[Pythonmac-SIG] A little x-platform issue...

Just van Rossum just@letterror.com
Wed, 12 Jul 2000 08:41:01 +0100


At 9:51 PM -0400 11-07-2000, Richard Gordon wrote:
>I decided to take a swing at getting the adzapper.py proxy server
>(based on Medusa) running on a Mac and have stumbled thru various
>problems but am greatly puzzled by what happens when it hits a line
>that uses int(time.time()). On the Mac, Python chokes and returns a
>float overflow (or words to that effect) error, while both mkLinux
>and OpenBSD don't seem to mind. Exploring this a little further, I
>see that time.time() returns a value with 3 places to the right of
>the decimal on the *nix boxes while the Mac returns xxxxxxxxx.0. In
>my simple world, the Mac's value is already an integer so I just got
>rid of the int() part only to be foiled by something else later, but
>I was wondering what the deal is here? Why does this result in a
>float overflow?

You get an "OverflowError: float too large to convert" error. I noticed
that, too, the last time I played with Medusa.

I think in some earlier version of Python, time.time() returned an int, but
as MacPython's epoch is at 1900 (unix's is 1970), so a Mac date can't fit
in an (signed, 4 byte) int. So to try to convert it to an int anyway is
bad, and it's an honest bug in Medusa. Maybe you'd like to report it to Sam
Rushing? (Apart from this problem, Medusa runs fine under MacOS.)

Just