Author Trundle
Recipients Trundle, belopolsky, brett.cannon, cool-RR, giampaolo.rodola, gruszczy, loewis, nedbat, r.david.murray, techtonik, vstinner
Date 2011-03-07.02:01:04
SpamBayes Score 2.18714e-14
Marked as misclassified No
Message-id <1299463265.2.0.296686537593.issue1559549@psf.upfronthosting.co.za>
In-reply-to
Content
There are some issues with the patch:

- The check for size of `args` in `ImportError_init()` is wrong: You can't create an `ImportError` with 3 arguments now ("TypeError: ImportError expected 2 arguments, got 3")
- `ImportError_clear()` doesn't clear ``self->msg``.
- `ImportError_str()` doesn't increase the reference count for ``self->msg`` before returning it.
- The code that raises the exception (Python/import.c) doesn't check for error return values: All the calls can return NULL which will cause a segfault due to the uncoditional Py_DECREFs.
- Using `PyUnicode_DecodeASCII()` for the module name is wrong (IMHO), it should rather be something like `PyUnicode_DecodeUTF8()` as module names can contain non-ASCII characters in Python 3 and are AFAIK (at least right now) always encoded using utf-8.
History
Date User Action Args
2011-03-07 02:01:05Trundlesetrecipients: + Trundle, loewis, brett.cannon, belopolsky, vstinner, techtonik, giampaolo.rodola, nedbat, r.david.murray, gruszczy, cool-RR
2011-03-07 02:01:05Trundlesetmessageid: <1299463265.2.0.296686537593.issue1559549@psf.upfronthosting.co.za>
2011-03-07 02:01:04Trundlelinkissue1559549 messages
2011-03-07 02:01:04Trundlecreate