[issue20539] math.factorial may throw OverflowError

Gareth Rees report at bugs.python.org
Fri Feb 7 16:24:31 CET 2014


Gareth Rees added the comment:

It's not a case of internal storage overflowing. The error is from
Modules/mathmodule.c:1426 and it's the input 10**19 that's too large
to convert to a C long. You get the same kind of error in other
places where PyLong_AsLong or PyLong_AsInt is called on a
user-supplied value, for example:

    >>> import pickle
    >>> pickle.dumps(10**19, 10**19)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OverflowError: Python int too large to convert to C long

----------
nosy: +Gareth.Rees

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


More information about the Python-bugs-list mailing list