Skip to content

Popup windows "Making stdin/stdout/stderr inheritable failed" when when running a gui-script on Windows #10706

@deffi

Description

@deffi

Summary

When using uv run or uv tool run to run a script from [project.gui-scripts] in pyproject.toml, 3 popup messages are displayed before the script is started:

  • "Making stdin inheritable failed"
  • "Making stdout inheritable failed"
  • "Making stderr inheritable failed"

This is regardless of whether the script is doing anything GUI related or not.

To reproduce

Preparation:

  • uv init --app --package foo
  • In pyproject.toml, replace [project.scripts] with [project.gui-scripts]

Issue demonstration, in foo/:

  • uv run foo → popup messages
  • uv tool run --from . foo → popup messages

On the other hand, this works as expected:

  • .venv\Scripts\foo.exe → no popups
  • uv tool install . & foo → no popups

Output from uv --verbose run foo:

Output
DEBUG uv 0.5.20 (1c17662b3 2025-01-15)
DEBUG Found project root: `c:\Users\[...]\foo`
DEBUG No workspace root found, using project root
DEBUG Discovered project `foo` at: c:\Users\[...]\foo
DEBUG Reading Python requests from version file at `c:\Users\[...]\foo\.python-version`
DEBUG Using Python request `3.13` from version file at `.python-version`
DEBUG The virtual environment's Python version satisfies `3.13`
DEBUG Using request timeout of 30s
DEBUG Found static `pyproject.toml` for: foo @ file:///C:/Users/[...]/foo
DEBUG No workspace root found, using project root
DEBUG Existing `uv.lock` satisfies workspace requirements
Resolved 1 package in 10ms
DEBUG Using request timeout of 30s
DEBUG Requirement already installed: foo==0.1.0 (from file:///C:/Users/[...]/foo)
Audited 1 package in 0.49ms
DEBUG Using Python 3.13.1 interpreter at: C:\Users\[...]\foo\.venv\Scripts\python.exe
DEBUG Running `foo`
DEBUG Command exited with code: 0

Additional information

For scripts in [project.scripts] (as opposed to [project.gui-scripts]), this does not happen.

The message seems to be generated by the spawn_child function in uv-trampoline's bounce.rs.

Redirecting the output changes the behavior slightly:

  • uv run foo >1.txt → popups only for "stdin" and "stderr", output of foo in 1.txt
  • uv run foo 2>2.txt → no popups, messages written to 2.txt instead

Versions

Windows 11 Version 23H2 (Build 22631.4460)
uv 0.5.20 (1c17662 2025-01-15)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindowsSpecific to the Windows platform

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions