Message65261
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.) |
|
| Date |
User |
Action |
Args |
| 2008-04-09 19:40:03 | belopolsky | set | spambayes_score: 0.0621366 -> 0.0621366 recipients:
+ belopolsky, gregory.p.smith, amaury.forgeotdarc, jnferguson |
| 2008-04-09 19:40:03 | belopolsky | link | issue2587 messages |
| 2008-04-09 19:40:02 | belopolsky | create | |
|