class_docstr: Helper for reporting Python subprocess run results
docstr: Provide helpful details about failed subcommand runs
docstr_tok: ["Provide","helpful","details","about","failed","subcommand","runs"]
code: def fail(self, cmd_line):
      """Provide helpful details about failed subcommand runs"""
      # Limit to 80 lines to ASCII characters
      maxlen = 80 * 100
      out, err = self.out, self.err
      if len(out) > maxlen:
          out = b"(... truncated stdout ...)" + out[-maxlen:]
      if len(err) > maxlen:
          err = b"(... truncated stderr ...)" + err[-maxlen:]
      out = out.decode("ascii", "replace").rstrip()
      err = err.decode("ascii", "replace").rstrip()
      raise AssertionError(
          "Process return code is %d\n"
          "command line: %r\n"
          "\n"
          "stdout:\n"
          "---\n"
          "%s\n"
          "---\n"
          "\n"
          "stderr:\n"
          "---\n"
          "%s\n"
          "---" % (self.rc, cmd_line, out, err)
      )
  
imports: import collections
  import importlib
  import sys
  import os
  import os.path
  import subprocess
  import py_compile
  from importlib.util import source_from_cache
  from test import support
  from test.support.import_helper import make_legacy_pyc
label_desc: Use image node_id 1 for calling the _PythonRunResult obj's underlying member method code with example usage: obj.fail(cmd_line) without return types