[merge] don't treat enoent from readdir as indicating eof

Andrew Bennetts andrew at canonical.com
Tue Oct 7 07:34:30 BST 2008


Martin Pool wrote:
> As a follow on from my previous patch, this makes ENOENT from readdir
> just be treated as a regular error.
> 
> I can't find any clear indication on the web of what would be the
> correct way to handle it, and it seems unlikely that it will be
> raised.  I think if we were seeing it before, it probably was because
> of bug 279381.  It seems to me that unless we specifically know that
> it indicates the end of the directory, it's unsafe to treat it as
> such.   If we merge this change and it causes a real exception, we can
> find out more about situations where it does occur.

I think your theory that it's due to 279381 makes sense: Python triggers a lot
of ENOENTs in its import machinery (just look at the strace log in that bug; if
it wasn't for the failed attempt to rewrite a root-owned pyc file the last error
would have been ENOENT).

So I'm in favour of merging this.

bb:approve

-Andrew.




More information about the bazaar mailing list