Issues / #393

#393 setup.py: ask() takes the default on EOF, so a non-interactive run installs VS Build Tools + CUDA via winget

closed · @Efs-O · 2 comments · View on GitHub

Setup & installNVIDIA / CUDA

Description

`ask()` (setup.py:151) returns `default` on `EOFError`. The build-tools prompt (setup.py:1053) is

```
if ask("  Install them now?", ["y", "n"], "y", yes) != "y":
```

with default `"y"`. So a run with stdin closed or redirected goes straight to `winget install ... --disable-interactivity` for Visual Studio 2022 Build Tools and CUDA 13.0, about 8-10 GB. Examples: a CI step, an agent driving the installer, or `python setup.py < NUL`. Nobody answered yes.

**Suggestion:**
- On EOF, either fail or use the *safe* default for prompts that install system software.
- Or make the default for this prompt `"n"` whenever stdin is not a TTY.

`--yes` already covers the case where someone really wants unattended installs.

Related on this site

Quick links to related pages.