Issue 33244: Overflow error - Python tracker (original) (raw)
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 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.