[PATCH] lazymanifest: check more return values in filtercopy

Augie Fackler raf at durin42.com
Wed Jan 6 15:25:11 CST 2016


> On Jan 6, 2016, at 12:58 AM, Martin von Zweigbergk <martinvonz at google.com> wrote:
> 
> +               arg = PyString_FromString(self->lines[i].start);
> +               if (!arg) {
> +                       PyErr_SetString(PyExc_TypeError,
> +                                       "couldn't pack filename");
> 
> TypeError seems wrong here. Most likely out of memory? Should we just leave it as whatever it was already set to? We don't set it when PyTuple_Pack() below fails.

I’m fine with some other error type. My reading of the docs didn’t suggest PyString_FromString *would* set some sort of error condition, and I’m being paranoid at this point.

(The docs state that it’ll set a TypeError if it get’s a non-string param, but it’s unclear to me what other failure states will produce. I suppose I could read the source…)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20160106/e26e723a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20160106/e26e723a/attachment.pgp>


More information about the Mercurial-devel mailing list