docs: def _getDiagnosticString():
      """Generate a diagnostic string, showing the module version, the platform, current directory etc.
  
      Returns:
          A descriptive string.
  
      """
      text = '\n## Diagnostic output from minimalmodbus ## \n\n'
      text += 'Minimalmodbus version: ' + __version__ + '\n'
      text += 'Minimalmodbus status: ' + __status__ + '\n'
      text += 'File name (with relative path): ' + __file__ + '\n'
      text += 'Full file path: ' + os.path.abspath(__file__) + '\n\n'
      text += 'pySerial version: ' + serial.VERSION + '\n'
      text += 'pySerial full file path: ' + os.path.abspath(serial.__file__) + '\n\n'
      text += 'Platform: ' + sys.platform + '\n'
      text += 'Filesystem encoding: ' + repr(sys.getfilesystemencoding()) + '\n'
      text += 'Byteorder: ' + sys.byteorder + '\n'
      text += 'Python version: ' + sys.version + '\n'
      text += 'Python version info: ' + repr(sys.version_info) + '\n'
      text += 'Python flags: ' + repr(sys.flags) + '\n'
      text += 'Python argv: ' + repr(sys.argv) + '\n'
      text += 'Python prefix: ' + repr(sys.prefix) + '\n'
      text += 'Python exec prefix: ' + repr(sys.exec_prefix) + '\n'
      text += 'Python executable: ' + repr(sys.executable) + '\n'
      try:
          text += 'Long info: ' + repr(sys.long_info) + '\n'
      except:
          text += 'Long info: (none)\n'  # For Python3 compatibility
      try:
          text += 'Float repr style: ' + repr(sys.float_repr_style) + '\n\n'
      except:
          text += 'Float repr style: (none) \n\n'  # For Python 2.6 compatibility
      text += 'Variable __name__: ' + __name__ + '\n'
      text += 'Current directory: ' + os.getcwd() + '\n\n'
      text += 'Python path: \n'
      text += '\n'.join(sys.path) + '\n'
      text += '\n## End of diagnostic output ## \n'
      return text