From: Martin Panter Date: Sun, 6 Dec 2015 11:12:15 +0000 (+0000) Subject: Issue #25717: Add comment explaining why errors are ignored X-Git-Tag: v3.6.0a1~945^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=49d3db92a4c3d9ddfa1babf82c9b20383725a24d;p=thirdparty%2FPython%2Fcpython.git Issue #25717: Add comment explaining why errors are ignored --- diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index 5f88d58c45a4..dbd604a11689 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -443,6 +443,9 @@ _io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode, fstat_result = _Py_fstat_noraise(self->fd, &fdfstat); Py_END_ALLOW_THREADS if (fstat_result < 0) { + /* Tolerate fstat() errors other than EBADF. See Issue #25717, where + an anonymous file on a Virtual Box shared folder filesystem would + raise ENOENT. */ #ifdef MS_WINDOWS if (GetLastError() == ERROR_INVALID_HANDLE) { PyErr_SetFromWindowsErr(0);