New submission from Larry Hastings <la...@hastings.org>: #15261 shows us that Windows can crash if you pass in an invalid file handle to Windows POSIX-y functions. We should ensure that functions which accept path-as-an-int-fd guard against this where necessary.
I propose a macro, something like #ifdef MS_WINDOWS #define FD_GUARD(fd) (_PyVerify_fd(fd) ? (fd) : INVALID_HANDLE_VALUE) #else #define FD_GUARD(fd) (fd) #endif ---------- assignee: larry components: Library (Lib) messages: 164722 nosy: amaury.forgeotdarc, larry, sbt priority: normal severity: normal stage: needs patch status: open title: Guard against invalid file handles in os functions type: behavior versions: Python 3.3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15263> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com