ensure_readable_fileobj

ensure_readable_fileobj#

tollan.utils.file.ensure_readable_fileobj(arg, *args, **kwargs)[source]#

Return a readable object.

This differs from the astropy.utils.data.get_readable_fileobj in that it is no-op if arg is already readable.

Parameters:
  • arg (str | PathLike | readable object) – File path or object with read() method

  • *args – Additional arguments passed to get_readable_fileobj

  • **kwargs – Keyword arguments passed to get_readable_fileobj