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

SourceForge.net noreply at sourceforge.net
Thu Nov 18 07:26:04 CET 2004


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

Category: Python Interpreter Core
Group: Python 2.3
>Status: Closed
>Resolution: Wont Fix
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: Raymond Hettinger (rhettinger)
Date: 2004-11-18 01:26

Message:
Logged In: YES 
user_id=80475

This seems like reasonable behavior to me.  If it did work
for some reason, it would be asking for hard to find user
bugs.  Closing as won't fix.

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

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


More information about the Python-bugs-list mailing list