Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
Many os functions started to accept file descriptors. I don't know how many are
available on Windows, but IMO _PyVerify_fd() could be used for all of them;
it's a no-op macro on Unix anyway.
--
nosy: +amaury.forgeotdarc, larry
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 62b9bfbc3356 by Richard Oudkerk in branch 'default':
Issue #15261: Stop os.stat(fd) crashing on Windows when fd not open.
http://hg.python.org/cpython/rev/62b9bfbc3356
--
nosy: +python-dev
Richard Oudkerk shibt...@gmail.com added the comment:
Many os functions started to accept file descriptors.
I don't know how many are available on Windows...
On Windows os.stat() seems to be the only one:
os.supports_fd
{built-in function stat}
--
Changes by Richard Oudkerk shibt...@gmail.com:
--
resolution: - fixed
stage: needs patch - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15261
___
Larry Hastings la...@hastings.org added the comment:
The 62b9bfbc3356 changeset does more than add the guard against invalid file
handles; it also adds documentation to os.path.exists documenting that it now
accepts path-as-int-fd. While this modification is fine in principle I would
have
Richard Oudkerk shibt...@gmail.com added the comment:
Sorry about that...
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15261
___
___
New submission from Richard Oudkerk shibt...@gmail.com:
In Python 3.3 (but not earlier) os.stat() is documented to work with file
descriptors. (os.path.exists() also works with fds since it is implemented in
terms of os.stat(), although that is *not* documented.)
However, on Windows if fd is
Richard Oudkerk shibt...@gmail.com added the comment:
This can probably be fixed by using _PyVerify_fd().
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15261
___