Skip to content

Batch activators unexpectedly turn echo off for subsequent commands #96894

@pawelszramowski

Description

@pawelszramowski

Bug report

Consider the following batch script:

python -m venv venv
CALL venv\Scripts\activate.bat
REM spam
CALL deactivate.bat
REM eggs

The expected output is:

W:\>python -m venv venv

W:\>CALL venv\Scripts\activate.bat

(venv) W:\>REM spam

(venv) W:\>CALL deactivate.bat

W:\>REM eggs

The actual output is:

W:\>python -m venv venv

W:\>CALL venv\Scripts\activate.bat

This is caused by @echo off at the beginning of both scripts that need to be undone after calling them:

python -m venv venv
CALL venv\Scripts\activate.bat
@ECHO ON
REM spam
CALL deactivate.bat
@ECHO ON
REM eggs

Your environment

  • CPython versions tested on: Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)]

Linked PRs

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