class_docstr: Subprocess communication protocol base class for `run_async_cmd`
  
  This class implements basic subprocess output handling. Derived classes
  like `StdOutCapture` should be used for subprocess communication that need
  to capture and return output. In particular, the `pipe_data_received()`
  method can be overwritten to implement "online" processing of process
  output.
  
  This class defines a default return value setup that causes
  `run_async_cmd()` to return a 2-tuple with the subprocess's exit code
  and a list with bytestrings of all captured output streams.
docstr: Called when the connection is lost or closed.
  
  The argument is an exception object or None (the latter
  meaning a regular EOF is received or the connection was
  aborted or closed).
docstr_tok: ["Called","when","the","connection","is","lost","or","closed",".","The","argument","is","an","exception","object","or","None","(","the","latter","meaning","a","regular","EOF","is","received","or","the","connection","was","aborted","or","closed",")","."]
code: def connection_lost(self, exc: Optional[BaseException]) -> None:
      """Called when the connection is lost or closed.
  
      The argument is an exception object or None (the latter
      meaning a regular EOF is received or the connection was
      aborted or closed).
      """
  
imports: from __future__ import annotations
  import logging
  import subprocess
  import warnings
  from collections import deque
  from locale import getpreferredencoding
  from typing import Any, Optional
  from datalad.utils import ensure_unicode
  from .exception import CommandError
label_desc: Use image node_id 4 for calling the WitlessProtocol obj's underlying member method code with example usage: obj.connection_lost(exc) without return types