This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ocean-city
Recipients ocean-city
Date 2009-02-27.17:23:12
SpamBayes Score 2.253912e-08
Marked as misclassified No
Message-id <1235755397.37.0.107266248804.issue5384@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2009-02-27 17:23:17ocean-citysetrecipients: + ocean-city
2009-02-27 17:23:17ocean-citysetmessageid: <1235755397.37.0.107266248804.issue5384@psf.upfronthosting.co.za>
2009-02-27 17:23:13ocean-citylinkissue5384 messages
2009-02-27 17:23:12ocean-citycreate