Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

subprocess.Popen doesn't properly escape < or > for windows batch files #133545

Labels
OS-windowsstdlibPython modules in the Lib dirtopic-subprocessSubprocess issues.type-bugAn unexpected behavior, bug, or error
@jefsayshi

Description

@jefsayshi

Bug report

Bug description:

subprocess.Popen doesn't properly escape< or> for windows batch files

example.bat

echo %*

example.py

importsubprocessfrompathlibimportPathbatch_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

No one assigned

    Labels

    OS-windowsstdlibPython modules in the Lib dirtopic-subprocessSubprocess issues.type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp