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 vstinner
Recipients benjamin.peterson, hynek, josh.r, pitrou, python-dev, steve.dower, stutzbach, tim.golden, vstinner, zach.ware
Date 2015-02-21.17:45:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAMpsgwZ1WodDDCnYUFJYt+hL7-UqeKU8rxEdBbq-nQ3z43hkAA@mail.gmail.com>
In-reply-to <20150221165042.99276.12894@psf.io>
Content
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.)
History
Date User Action Args
2015-02-21 17:45:53vstinnersetrecipients: + vstinner, pitrou, tim.golden, benjamin.peterson, stutzbach, python-dev, hynek, zach.ware, steve.dower, josh.r
2015-02-21 17:45:53vstinnerlinkissue23152 messages
2015-02-21 17:45:53vstinnercreate