code: def filesys_decode(path):
      
  
      if isinstance(path, six.text_type):
          return path
  
      fs_enc = sys.getfilesystemencoding() or 'utf-8'
      candidates = fs_enc, 'utf-8'
  
      for enc in candidates:
          try:
              return path.decode(enc)
          except UnicodeDecodeError:
              continue
docs: Ensure that the given path is decoded,
      NONE when no expected encoding works