Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overflow error seek()ing with float values > (2 ** 31) - 1 #41183

Closed
churchr mannequin opened this issue Nov 17, 2004 · 2 comments
Closed

Overflow error seek()ing with float values > (2 ** 31) - 1 #41183

churchr mannequin opened this issue Nov 17, 2004 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@churchr
Copy link
Mannequin

churchr mannequin commented Nov 17, 2004

BPO 1067756

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2004-11-17.01:47:10.000>
created_at = <Date 2004-11-17.01:10:40.000>
labels = ['interpreter-core']
title = 'Overflow error seek()ing with float values > (2 ** 31) - 1'
updated_at = <Date 2004-11-17.01:47:10.000>
user = 'https://bugs.python.org/churchr'

bugs.python.org fields:

activity = <Date 2004-11-17.01:47:10.000>
actor = 'nnorwitz'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2004-11-17.01:10:40.000>
creator = 'churchr'
dependencies = []
files = []
hgrepos = []
issue_num = 1067756
keywords = []
message_count = 2.0
messages = ['23175', '23176']
nosy_count = 2.0
nosy_names = ['nnorwitz', 'churchr']
pr_nums = []
priority = 'normal'
resolution = 'duplicate'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1067756'
versions = ['Python 2.3']

@churchr
Copy link
Mannequin Author

churchr mannequin commented Nov 17, 2004

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

@churchr churchr mannequin closed this as completed Nov 17, 2004
@churchr churchr mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Nov 17, 2004
@churchr churchr mannequin closed this as completed Nov 17, 2004
@churchr churchr mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Nov 17, 2004
@nnorwitz
Copy link
Mannequin

nnorwitz mannequin commented Nov 17, 2004

Logged In: YES
user_id=33168

Dupe of 1067728

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

No branches or pull requests

0 participants