]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #25717: Add comment explaining why errors are ignored
authorMartin Panter <vadmium+py@gmail.com>
Sun, 6 Dec 2015 11:12:15 +0000 (11:12 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Sun, 6 Dec 2015 11:12:15 +0000 (11:12 +0000)
Modules/_io/fileio.c

index 5f88d58c45a455b101f947702b524b47475189ff..dbd604a1168907baf3bc9986875f325a42f88a39 100644 (file)
@@ -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);