Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Wed, Apr 9, 2008 at 3:08 PM, Justin Ferguson <[EMAIL PROTECTED]> wrote:
> Okay, so I'm not sure whose point of view takes precedence here? I don't have a strong view on this, but just a few points to consider: 1. If you change PyString_FromStringAndSize, you should change PyBytes_FromStringAndSize and PyUnicode_FromStringAndSize for consistency. 2. Non-debug check should probably set a ValueError exception and return NULL. Think what kind of message you can generate inside *_FromStringAndSize that would be helpful to the end user. The caller is likely to be able to provide a much better diagnostic. 3. Maybe instead of setting a ValueError, a SystemError should be raised. In this case the calle will still be clearly responsible for the pre-condition, but programming errors will not present security concerns. 4. You have clearly identified several bugs that are not covered by unittests. If you fix them en-mass by making PyString_FromStringAndSize more forgiving, we will miss an opportunity to improve the test coverage. (If you take the SystemError approach, this does not apply.) __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2587> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com