Message236376
The name of attribute_data_to_stat() and other shared functions must be
prefixed by "_Py".
+/* Return size of file in bytes; < 0 if unknown or INT_MAX if too big */
static off_t getfilesize(FILE *fp)
Hum since we have a type able yo store the file size and the function is
private, you should use the type able to store the size. Maybe off_t on
POSIX and something else on Windows. Is Py_off_t type 64 bits?
I'm the sure that the caller works if getfilesize() returns a truncated
size.
@@ -420,9 +420,11 @@ fileio_init(PyObject *oself, PyObject *a }
self->blksize = DEFAULT_BUFFER_SIZE; -#ifdef HAVE_FSTAT - if
(fstat(self->fd, &fdfstat) < 0) +#if defined(HAVE_FSTAT) ||
defined(MS_WINDOWS) + if (_Py_fstat(self->fd, &fdfstat) < 0) { +
PyErr_SetFromErrno(PyExc_OSError); goto error; + }
Why do you raise an exception here? Is it a bug fix? (I cannot read the
code at error label right now.) |
|
Date |
User |
Action |
Args |
2015-02-21 17:45:53 | vstinner | set | recipients:
+ vstinner, pitrou, tim.golden, benjamin.peterson, stutzbach, python-dev, hynek, zach.ware, steve.dower, josh.r |
2015-02-21 17:45:53 | vstinner | link | issue23152 messages |
2015-02-21 17:45:53 | vstinner | create | |
|