Author belopolsky
Recipients amaury.forgeotdarc, belopolsky, gregory.p.smith, jnferguson
Date 2008-04-09.19:40:02
SpamBayes Score 0.0621366
Marked as misclassified No
Message-id <d38f5330804091239j2b6d3ba6r2156f7d5ce5fb882@mail.gmail.com>
In-reply-to <1207768095.05.0.0865298544128.issue2587@psf.upfronthosting.co.za>
Content
On Wed, Apr 9, 2008 at 3:08 PM, Justin Ferguson <report@bugs.python.org> 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.)
History
Date User Action Args
2008-04-09 19:40:03belopolskysetspambayes_score: 0.0621366 -> 0.0621366
recipients: + belopolsky, gregory.p.smith, amaury.forgeotdarc, jnferguson
2008-04-09 19:40:03belopolskylinkissue2587 messages
2008-04-09 19:40:02belopolskycreate