Nitish <nitishchandrachi...@gmail.com> added the comment:

The problem is with the following check:

    n = digits * bits_per_char + PyLong_SHIFT - 1;
    if (n / bits_per_char < p - start) {
        PyErr_SetString(PyExc_ValueError,
                        "int string too large to convert");

The problem is that n / bits_per_char gives the number of digits required. But 
p - start has the number of '_'s included in it. So even for valid cases, if 
the number of '_'s is above a limit, this check holds true and an overflow is 
raised.

Fix: Replace p - start with the actual number of digits.

----------
nosy: +nitishch

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31619>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to