Message82849
It seems mmap module is using inappropriate exception types. For example,
if (! (PyString_Check(v)) ) {
PyErr_SetString(PyExc_IndexError,
"mmap slice assignment must be a string");
return -1;
}
I think this should be PyExc_TypeError.
if (self->size >= pos && count > self->size - pos) {
PyErr_SetString(PyExc_ValueError,
"source or destination out of range");
return NULL;
I think this is out of range, so PyExc_IndexError.
Of course, there is the case difficult to determine which exception is
suitable. For example, if Py_ssize_t is negative value, OverflowError or
IndexError? |
|
Date |
User |
Action |
Args |
2009-02-27 17:23:17 | ocean-city | set | recipients:
+ ocean-city |
2009-02-27 17:23:17 | ocean-city | set | messageid: <1235755397.37.0.107266248804.issue5384@psf.upfronthosting.co.za> |
2009-02-27 17:23:13 | ocean-city | link | issue5384 messages |
2009-02-27 17:23:12 | ocean-city | create | |
|