The bundled Public Suffix List, file locks, owner-only file rule, owner-only sockets and directories, the trust-boundary socket receiver, atomic file publish, process-group stops, text elision and terminal-safe text every glovebox component shares
Actively maintained. Last release 2 days ago, commits in 26 of the last 26 weeks. A safe choice.
pip install glovebox-hostsREADME as published on PyPI with version 0.14.7.
glovebox-hosts
The helpers every part of glovebox shares that read or write outside the process: the bundled Public Suffix List, file locks, owner-only files, sockets and directories, atomic file publish, process-group stops, text elision and terminal-safe text. The host rules and the JSON reader live in glovebox-core.
BUNDLED_SUFFIXES is the Public Suffix List that tldextract bundles, read offline. Pass it to each glovebox_core.host_rules rule that judges a name against that list. tldextract is imported only when a name is judged, so a python without it raises SuffixListUnread there and nowhere else.
python3 -m glovebox_hosts runs the host rules for a caller outside Python: name-check judges one name.
glovebox_hosts.display_text reads the one list of Unicode categories unsafe to print on a terminal. escape_unsafe spells each such character out, so an escape sequence prints as inert text.
glovebox_hosts.flock holds an exclusive file lock: held, for a block. It lives here because the host tools and the monitor package can both import it.
glovebox_hosts.boundary receives bytes across a trust boundary on a Unix socket. peer names the far end from the kernel's SO_PEERCRED. read and message cap the bytes and hold one deadline for the whole read, and raise TooLong or TooSlow. The launcher and the node stack import it from here.
glovebox_hosts.proc_handle follows a process through a kernel handle and stops a process group as one unit. run_group runs a child under a timeout that stops the grandchildren too. The launcher, the monitor, the driver and the eval harnesses all import it from here.
glovebox_hosts.failed_command gives a failed command's reason: failure_reason names the program, how it ended and the last lines of its stderr, masked by the install's secret masker and bounded. output_tail bounds and masks other captured output. A message that reports a failed command takes its reason from here.