[issue23363] integer overflow in itertools.permutations

Serhiy Storchaka report at bugs.python.org
Mon Feb 2 07:59:29 CET 2015


Serhiy Storchaka added the comment:

An overflow in n * sizeof(Py_ssize_t) is not possible because n is the length of already allocated array of pointers.

+        with self.assertRaises(OverflowError):
+            permutations("A", 2**30)

The test needs 4GiB. May be use 2**29?

+        with self.assertRaises(OverflowError):
+            permutations("A", 2, 2**30)

permutations() takes at most 2 arguments.

----------
nosy: +serhiy.storchaka
status: closed -> open

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


More information about the Python-bugs-list mailing list