code: def is_readonly_path(fn):
      
  
      fn = fs_encode(fn)
      if os.path.exists(fn):
          file_stat = os.stat(fn).st_mode
          return not bool(file_stat & stat.S_IWRITE) or not os.access(fn, os.W_OK)
      return False
docs: Check if a provided path exists and is readonly.
  
      Permissions check is `bool(path.stat & stat.S_IREAD)` or `not os.access(path, os.W_OK)`