Commit 88426fee authored by Martin Panter's avatar Martin Panter

Issue #25717: Add comment explaining why errors are ignored

parent c721d016
...@@ -443,6 +443,9 @@ _io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode, ...@@ -443,6 +443,9 @@ _io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode,
fstat_result = _Py_fstat_noraise(self->fd, &fdfstat); fstat_result = _Py_fstat_noraise(self->fd, &fdfstat);
Py_END_ALLOW_THREADS Py_END_ALLOW_THREADS
if (fstat_result < 0) { 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 #ifdef MS_WINDOWS
if (GetLastError() == ERROR_INVALID_HANDLE) { if (GetLastError() == ERROR_INVALID_HANDLE) {
PyErr_SetFromWindowsErr(0); PyErr_SetFromWindowsErr(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment