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 Oren Milman
Recipients Oren Milman, amaury.forgeotdarc, belopolsky, meador.inge, serhiy.storchaka
Date 2017-03-18.20:59:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489870748.39.0.572226921526.issue29843@psf.upfronthosting.co.za>
In-reply-to
Content
here is the patch updated according to your suggestions, Serhiy.


however, I wonder about the case of a too large _length_.
shouldn't we raise a MemoryError in such a case, in accordance with #29833?

BTW, while inspecting code related to a too large _length_, I came across this
(in PyCArrayType_new):
    if (length * itemsize < 0) {
        PyErr_SetString(PyExc_OverflowError,
                        "array too large");
        goto error;
    }
I am not sure, but isn't this check unsafe? (e.g. if length == 2 ** 30, and
itemsize == 4, couldn't the product be 0 on some platforms?)
but maybe the code before this check makes more checks. I didn't make a
thorough inspection...
History
Date User Action Args
2017-03-18 20:59:08Oren Milmansetrecipients: + Oren Milman, amaury.forgeotdarc, belopolsky, meador.inge, serhiy.storchaka
2017-03-18 20:59:08Oren Milmansetmessageid: <1489870748.39.0.572226921526.issue29843@psf.upfronthosting.co.za>
2017-03-18 20:59:08Oren Milmanlinkissue29843 messages
2017-03-18 20:59:08Oren Milmancreate