code: def walk(self, match=None, errors='strict'):
          
          class Handlers:
              def strict(msg):
                  raise
  
              def warn(msg):
                  warnings.warn(msg, TreeWalkWarning)
  
              def ignore(msg):
                  pass
  
          if not callable(errors) and errors not in vars(Handlers):
              raise ValueError("invalid errors parameter")
          errors = vars(Handlers).get(errors, errors)
  
          match = matchers.load(match)
  
          try:
              childList = self.listdir()
          except Exception:
              exc = sys.exc_info()[1]
              tmpl = "Unable to list directory '%(self)s': %(exc)s"
              msg = tmpl % locals()
              errors(msg)
              return
  
          for child in childList:
              if match(child):
                  yield child
              try:
                  isdir = child.isdir()
              except Exception:
                  exc = sys.exc_info()[1]
                  tmpl = "Unable to access '%(child)s': %(exc)s"
                  msg = tmpl % locals()
                  errors(msg)
                  isdir = False
  
              if isdir:
                  for item in child.walk(errors=errors, match=match):
                      yield item
docs: D.walk() -> iterator over files and subdirs, recursively.
  
          The iterator yields Path objects naming each child item of
          this directory and its descendants.  This requires that
          ``D.isdir()``.
  
          This performs a depth-first traversal of the directory tree.
          Each directory is returned just before all its children.
  
          The `errors=` keyword argument controls behavior when an
          error occurs.  The default is ``'strict'``, which causes an
          exception.  Other allowed values are ``'warn'`` (which
          reports the error via :func:`warnings.warn()`), and ``'ignore'``.
          `errors` may also be an arbitrary callable taking a msg parameter.