~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_readdir_pyx.pyx

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-10-07 08:33:16 UTC
  • mfrom: (3766.2.1 readdir-enoent)
  • Revision ID: pqm@pqm.ubuntu.com-20081007083316-c4x5b3os195vdrbu
(mbp) Don't treat ENOENT from readdir as indicating end-of-directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
304
304
                else:
305
305
                    break
306
306
            if entry == NULL:
307
 
                if errno == ENOTDIR or errno == ENOENT or errno == 0:
 
307
                if errno == ENOTDIR or errno == 0:
308
308
                    # We see ENOTDIR at the end of a normal directory.
309
309
                    # As ENOTDIR for read_dir(file) is triggered on opendir,
310
310
                    # we consider ENOTDIR to be 'no error'.
311
 
                    #
312
 
                    # XXX: ENOENT is listed as 'invalid position in the dir stream' for
313
 
                    # readdir.  It's not clear what we should do about that
314
 
                    # case; at the moment we treat it as the end of the
315
 
                    # directory.
316
311
                    continue
317
312
                else:
318
313
                    raise OSError(errno, strerror(errno))