[issue33244] Overflow error

Terry J. Reedy report at bugs.python.org
Mon Apr 9 12:57:51 EDT 2018


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Vignesh: This issue tracker is for reporting bugs in the CPython interpreter.  Requests for help with problems with your code should go elsewhere, such as pythonlist mail list or stackoverflow.com web site.

In this case, your problem is described in the error message: you input an int that is too large for the array of C longs.  The following is a much shortened example equivalent to your code.

>>> import array
>>> longs = array.array('l',[])
>>> longs.append(2222222222222222222222222222222222222222222)
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    longs.append(2222222222222222222222222222222222222222222)
OverflowError: Python int too large to convert to C long

When a program gets input from a user, it must be prepared to catch and deal with exceptions.  If you have more questions, ask on a user help forum, such as the 2 I listed above.

----------
assignee: terry.reedy -> 
components:  -IDLE
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33244>
_______________________________________


More information about the Python-bugs-list mailing list