-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Open
Labels
OS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-subprocessSubprocess issues.Subprocess issues.type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
subprocess.Popen doesn't properly escape <
or >
for windows batch files
example.bat
echo %*
example.py
import subprocess
from pathlib import Path
batch_file = Path().cwd() / 'example.bat'
subprocess.Popen([batch_file, 'arg1', 'arg2<99'])
Error
The system cannot find the file specified
Adding a space causes it to be correctly escaped:
subprocess.Popen([batch_file, 'arg1', 'arg2 <99'])
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Linked PRs
Metadata
Metadata
Assignees
Labels
OS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-subprocessSubprocess issues.Subprocess issues.type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error