[ python-Bugs-1067756 ] Overflow error seek()ing with float values > (2 ** 31) - 1

SourceForge.net noreply at sourceforge.net
Wed Nov 17 02:47:10 CET 2004


Bugs item #1067756, was opened at 2004-11-16 20:10
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1067756&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
>Status: Closed
>Resolution: Duplicate
Priority: 5
Submitted By: Robert Church (churchr)
Assigned to: Nobody/Anonymous (nobody)
Summary: Overflow error seek()ing with float values > (2 ** 31) - 1

Initial Comment:
Passing a floating point value greater than (2**31) - 1
yields the exception:

OverflowError: long int too long to convert to int

# e.g., 

fh = open("/dev/zero", "rb")
fh.seek((2.0 ** 31) - 1)   # <--- works fine.

fh = open("/dev/zero", "rb")
fh.seek(2.0 ** 31)  # <--- throws the above  exception.

# Contrast with the behaviour with integers:

fh.seek(2 ** 31)  # works fine
fh.seek((2 ** 63) - 1)  # works fine
fh.seek(2 ** 63)  # throws the exception

----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2004-11-16 20:47

Message:
Logged In: YES 
user_id=33168

Dupe of 1067728

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1067756&group_id=5470


More information about the Python-bugs-list mailing list