Choose stdout/stderr targets for the temporary validation server process. ``arcade deploy`` starts a short-lived child server to validate the entrypoint before uploading. The child's stdout/stderr must be handled carefully: * **Normal mode** (``debug=False``): the CLI doesn't disp
(debug: bool)
| 412 | byte_stream = io.BytesIO() |
| 413 | with tarfile.open(fileobj=byte_stream, mode="w:gz") as tar: |
| 414 | tar.add(package_dir, arcname=package_dir.name, filter=exclude_filter) |
| 415 | |
| 416 | # Get bytes and encode to base64 |
| 417 | byte_stream.seek(0) |
| 418 | package_bytes = byte_stream.read() |
| 419 | package_bytes_b64 = base64.b64encode(package_bytes).decode("utf-8") |
| 420 | |
| 421 | return package_bytes_b64 |
| 422 | |
| 423 | |
| 424 | def _resolve_server_process_stdio(debug: bool) -> tuple[int | None, int | None]: |
| 425 | """Choose stdout/stderr targets for the temporary validation server process. |
| 426 | |
| 427 | ``arcade deploy`` starts a short-lived child server to validate the |
| 428 | entrypoint before uploading. The child's stdout/stderr must be handled |
| 429 | carefully: |
| 430 | |
| 431 | * **Normal mode** (``debug=False``): the CLI doesn't display child output, |
| 432 | so both streams are sent to ``subprocess.DEVNULL``. This prevents a |
| 433 | chatty child from filling the OS pipe buffer and blocking — which |
| 434 | manifests as intermittent health-check timeouts, especially on Windows |
| 435 | where the default pipe buffer is only 4 KiB. |
| 436 | * **Debug mode** (``debug=True``): both streams are inherited from the |
| 437 | parent process (``None``), so the user sees live startup logs in their |
| 438 | terminal for troubleshooting. |
| 439 | |
| 440 | Returns: |
no outgoing calls
no test coverage detected