docs: def _text_io_wrapper(stream, mode, encoding, errors, newline):
      """Wrap a binary stream to Text stream.
  
      Args:
          stream (file-like object): binary stream.
          mode (str): Open mode.
          encoding (str): Stream encoding.
          errors (str): Decoding error handling.
          newline (str): Universal newlines
      """
      # Text mode, if not already a text stream
      # That has the "encoding" attribute
      if "t" in mode and not hasattr(stream, 'encoding'):
          text_stream = TextIOWrapper(
              stream, encoding=encoding, errors=errors, newline=newline)
          yield text_stream
          text_stream.flush()
  
      # Binary mode (Or already text stream)
      else:
          yield stream