code: def readlink(self, path):
          
          if path is None:
              raise TypeError
          try:
              link_obj = self.lresolve(path)
          except IOError as exc:
              self.raise_os_error(exc.errno, path)
          if S_IFMT(link_obj.st_mode) != S_IFLNK:
              self.raise_os_error(errno.EINVAL, path)
  
          if self.ends_with_path_separator(path):
              if not self.is_windows_fs and self.exists(path):
                  self.raise_os_error(errno.EINVAL, path)
              if not self.exists(link_obj.path):
                  if self.is_windows_fs:
                      error = errno.EINVAL
                  elif self._is_circular_link(link_obj):
                      if self.is_macos:
                          return link_obj.path
                      error = errno.ELOOP
                  else:
                      error = errno.ENOENT
                  self.raise_os_error(error, link_obj.path)
  
          return link_obj.contents
docs: Read the target of a symlink.
  
          Args:
              path:  symlink to read the target of.
  
          Returns:
              the string representing the path to which the symbolic link points.
  
          Raises:
              TypeError: if path is None
              OSError: (with errno=ENOENT) if path is not a valid path, or
                  (with errno=EINVAL) if path is valid, but is not a symlink,
                  or if the path ends with a path separator (Posix only)