This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nitishch
Recipients georg.brandl, mark.dickinson, nitishch, serhiy.storchaka
Date 2017-09-29.08:28:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1506673728.12.0.213398074469.issue31619@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-09-29 08:28:48nitishchsetrecipients: + nitishch, georg.brandl, mark.dickinson, serhiy.storchaka
2017-09-29 08:28:48nitishchsetmessageid: <1506673728.12.0.213398074469.issue31619@psf.upfronthosting.co.za>
2017-09-29 08:28:48nitishchlinkissue31619 messages
2017-09-29 08:28:47nitishchcreate