INNER CODE UNIT · Python

_log_safe

RekklesNA/ProxmoxMCP-Plus · src/proxmox_mcp/server.py:63

def _log_safe(value: object, max_length: int = 200) -> str:
    text = str(value).replace("\r", "").replace("\n", "")
    return text[:max_length]


_LEGACY_SINGLE_TARGET_ATTRS = (
    "proxmox_manager", "proxmox", "job_store", "node_tools", "vm_tools",
    "storage_tools", "cluster_tools", "container_tools", "snapshot_tools",
    "iso_tools", "backup_tools", "jobs_tools", "log_tools",
)


def _exit_without_finalization(status: int = 0) -> NoReturn:
    """Terminate the process without running interpreter finalization.

    Raising ``SystemExit`` from a signal handler is unsafe under the stdio
    transport. The MCP SDK reads stdin from an AnyIO worker thread, using its
    own ``TextIOWrapper`` built on ``sys.stdin.buffer``

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…