[New-bugs-announce] [issue14794] slice.indices raises OverflowError

Paul Upchurch report at bugs.python.org
Sun May 13 00:51:38 CEST 2012


New submission from Paul Upchurch <paulup at gmail.com>:

To reproduce the error:

Python 3.2.2 (default, Sep  5 2011, 22:09:30) 
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> slice(0,90000,None).indices(12600000000)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: cannot fit 'int' into an index-sized integer
>>> 

The correct behaviour is to return (0, 90000, 1).

>>> slice(0,90000,None).indices(600000000)
(0, 90000, 1)

This is related to http://bugs.python.org/issue1456470.

----------
components: Interpreter Core
messages: 160500
nosy: Paul.Upchurch
priority: normal
severity: normal
status: open
title: slice.indices raises OverflowError
type: behavior
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14794>
_______________________________________


More information about the New-bugs-announce mailing list