This function is intended for low-level I/O. For normal usage,
use the built-in function \function{open()}, which returns a ``file
object'' with \method{read()} and \method{write()} methods (and many
-more).
+more). To wrap a file descriptor in a ``file object'', use
+\function{fdopen()}.
\end{notice}
\end{funcdesc}
Extension Modules
-----------------
+- Bug #1467952: os.listdir() now correctly raises an error if readdir()
+ fails with an error condition.
+
- Fix bsddb.db.DBError derived exceptions so they can be unpickled.
Library
}
Py_DECREF(v);
}
+ if (errno != 0 && d != NULL) {
+ /* readdir() returned NULL and set errno */
+ closedir(dirp);
+ Py_DECREF(d);
+ return posix_error_with_allocated_filename(name);
+ }
closedir(dirp);
PyMem_Free(name);