Skip to content

Starting a python script executes the script in a new console window #140589

@quetschke

Description

@quetschke

Bug report

Bug description:

This problem occurs on Windows 11 wit a new installation of Python 3.14 using the "Python install manager 25.0"

New behavior, when starting the following script (test.py)

import sys
sys.stdout.write("hello from Python %s\n" % (sys.version,))
input('press enter to exit')

in a cmd console window:

C:\_local_dev\>test.py

it opens a new window. It executes the code correctly, but for example output to stdout cannot be redirected into a file.

When using

C:\_local_dev\>py test.py

the execution happens in the current console window and stdout can be redirected.

On my previous 3.10 and 3.12 installations the execution of the script (without prepending py) no new windows were opened.

The old install manager and python version (old installer type) were removed. Only the new install manager and a python 3.14 installed with "py install 3.14" remains on the system.

Further details: I tested the behaviour for a domain user without administrator rights and a local Administrator. The previous python installation was installed "for all users", but the new Microsoft Store app does not seem to have that option and the respective py.exe files are in:
c:\Program Files\WindowsApps\PythonSoftwareFoundation.PythonManager_25.0.240.0_x64__qbz5n2kfra8p0\
with symlinks from
C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\py.exe
.

CPython versions tested on:

3.14

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowstype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions