http://bugs.python.org/review/15177/diff/5233/Lib/os.py File Lib/os.py (right): http://bugs.python.org/review/15177/diff/5233/Lib/os.py#newcode519 Lib/os.py:519: supports_dir_fd.add(fwalk) Please don't add this. It doesn't make any sense since you can't test for it.
http://bugs.python.org/review/15177/diff/5233/Lib/os.py File Lib/os.py (right): http://bugs.python.org/review/15177/diff/5233/Lib/os.py#newcode519 Lib/os.py:519: supports_dir_fd.add(fwalk) On 2012/06/25 10:43:12, Georg wrote: > Please don't add this. It doesn't make any sense since you can't test for it. Done.
http://bugs.python.org/review/15177/diff/5238/Doc/library/os.rst File Doc/library/os.rst (right): http://bugs.python.org/review/15177/diff/5238/Doc/library/os.rst#newcode2218 Doc/library/os.rst:2218: ``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``. But walk also supports dir_fd. http://bugs.python.org/review/15177/diff/5238/Lib/os.py File Lib/os.py (right): http://bugs.python.org/review/15177/diff/5238/Lib/os.py#newcode341 Lib/os.py:341: return False Should onerror handler be used? http://bugs.python.org/review/15177/diff/5238/Lib/os.py#newcode419 Lib/os.py:419: close(close_me) What if error happens on close? http://bugs.python.org/review/15177/diff/5238/Lib/os.py#newcode446 Lib/os.py:446: if followlinks or not islink(new_path): st.S_ISLINK(stat(name, dir_fd=close_me).st_mode) ?
This isn't happening for 3.3 anyway, but maybe it'll go in for 3.4. (I'll talk to the 3.4 RM.) http://bugs.python.org/review/15177/diff/5238/Doc/library/os.rst File Doc/library/os.rst (right): http://bugs.python.org/review/15177/diff/5238/Doc/library/os.rst#newcode2218 Doc/library/os.rst:2218: ``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``. On 2012/06/25 14:08:10, storchaka wrote: > But walk also supports dir_fd. Wishful thinking for now ;-) but, Done. http://bugs.python.org/review/15177/diff/5238/Lib/os.py File Lib/os.py (right): http://bugs.python.org/review/15177/diff/5238/Lib/os.py#newcode341 Lib/os.py:341: return False On 2012/06/25 14:08:10, storchaka wrote: > Should onerror handler be used? I have a much better implementation, so this one is best forgotten. The new implementation is just seven lines right at the top of os.walk, and looks basically like this: if they pass in dir_fd: if fwalk is unavailable throw NotImplementedError for tuple in fwalk(args): yield tuple[:-1] return http://bugs.python.org/review/15177/diff/5238/Lib/os.py#newcode419 Lib/os.py:419: close(close_me) On 2012/06/25 14:08:10, storchaka wrote: > What if error happens on close? Obviated by new implementation. http://bugs.python.org/review/15177/diff/5238/Lib/os.py#newcode446 Lib/os.py:446: if followlinks or not islink(new_path): On 2012/06/25 14:08:10, storchaka wrote: > st.S_ISLINK(stat(name, dir_fd=close_me).st_mode) ? Obviated by new implementation.