[issue15177] Support os.walk(dir_fd=) and os.fwalk(dir_fd=)

Larry Hastings report at bugs.python.org
Mon Jun 25 06:13:22 CEST 2012


New submission from Larry Hastings <larry at hastings.org>:

Consider: should os.fwalk() support dir_fd?  I think so.  In fact, in retrospect it seems like a bug that os.fwalk *doesn't* already support this.

Georg: is this a feature or a bugfix?

(Wish I'd thought of this Saturday!)

I actually did a little experimenting, and got os.fwalk(fd) to work with very little trouble.  os.walk(fd) is harder because the recursive step appends a string to the existing path, and it really needs to be relative to the fd, and there's no way to pass both of those at once with the current signature.  It's doable but it would require a separate function for the recursive step that accepted a dir_fd anyway.

----------
assignee: larry
messages: 163886
nosy: georg.brandl, hynek, larry, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: Support os.walk(dir_fd=) and os.fwalk(dir_fd=)
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15177>
_______________________________________


More information about the Python-bugs-list mailing list