[issue5395] array.fromfile not checking I/O errors

2009-10-05 Thread Eduardo Aguiar
Eduardo Aguiar added the comment: Maybe you could create a file without read permission (000) and try to read from it. -- ___ Python tracker <http://bugs.python.org/issue5

[issue5395] array.fromfile not checking I/O errors

2009-10-06 Thread Eduardo Aguiar
Eduardo Aguiar added the comment: Another try. I have opened a file for writing, and have tried to read from it: >>> fp = open ('xxx', 'w') >>> fp.read () Traceback (most recent call last): File "", li

[issue5395] array.fromfile not checking I/O errors

2009-02-28 Thread Eduardo Aguiar
New submission from Eduardo Aguiar : At arraymodule.c (line 1258): nread = fread(item + (Py_SIZE(self) - n) * itemsize, itemsize, n, fp); if (nread < (size_t)n) { Py_SIZE(self) -= (n - nr

[issue5396] os.read not handling O_DIRECT flag

2009-02-28 Thread Eduardo Aguiar
New submission from Eduardo Aguiar : At posixmodule.c (line 6306) static PyObject * posix_read(PyObject *self, PyObject *args) { int fd, size, n; PyObject *buffer; if (!PyArg_ParseTuple(args, "ii:read", &fd, &size)) return NULL;

[issue5396] os.read not handling O_DIRECT flag

2009-03-15 Thread Eduardo Aguiar
Eduardo Aguiar added the comment: Hi, I think I have a few more issues you can consider: 1) to allocated an aligned buffer it is as simple as allocate 4096 + len (buffer) and truncate address to 4k boundary. 2) I wrote a floppy imager, and without O_DIRECT, it gives me 8 sectors (4k = kernel