calls fstat() once. Before fstat() was called twice, which was not necessary.
Python News
+++++++++++
+What's New in Python 3.5.0 alpha 4?
+===================================
+
+Release date: XXX
+
+Core and Builtins
+-----------------
+
+Library
+-------
+
+- Issue #23752: When built from an existing file descriptor, io.FileIO() now
+ only calls fstat() once. Before fstat() was called twice, which was not
+ necessary.
+
+Build
+-----
+
+Tests
+-----
+
+Tools/Demos
+-----------
+
+
+
What's New in Python 3.5.0 alpha 3?
===================================
return (PyObject *) self;
}
-static int
-check_fd(int fd)
-{
- struct _Py_stat_struct buf;
- if (_Py_fstat(fd, &buf) < 0 &&
-#ifdef MS_WINDOWS
- GetLastError() == ERROR_INVALID_HANDLE
-#else
- errno == EBADF
-#endif
- ) {
- PyObject *exc;
- char *msg = strerror(EBADF);
- exc = PyObject_CallFunction(PyExc_OSError, "(is)",
- EBADF, msg);
- PyErr_SetObject(PyExc_OSError, exc);
- Py_XDECREF(exc);
- return -1;
- }
- return 0;
-}
-
#ifdef O_CLOEXEC
extern int _Py_open_cloexec_works;
#endif
#endif
if (fd >= 0) {
- if (check_fd(fd))
- goto error;
self->fd = fd;
self->closefd = closefd;
}