Azure / Azure/azure-devops-cli-extension

[Bug] "Failed to load python executable" when setting variable-group variable when value contains certain patterns

Open
#1,020 7 comments 0 reactions 0 assignees View on GitHub
Area: ProToCol bug
Dominant language
Python
Stars
682
Forks
278
Avg merge
3d 23h
Merged PRs (30d)
3

Description

**Describe the bug**
When I use Azure CLI from PowerShell, I am receiving a "Failed to load python executable" error when I attempt to create or update a variable group variable when the value of the variable contains a "-" (dash) character and ends with ")" (closing paren).

Note that this only happens when I run from PowerShell. When I run from CMD it works without error.

**To Reproduce**
Azure Cli Version: 2.7.0

Azure-Devops extension version: 0.18.0

Steps to reproduce the behavior:
1. login using az login
2. setup defaults.
3. Run command:
```
az pipelines variable-group variable create --group-id --name my.variable.name --value '$(some-text)'
```
OR
```
az pipelines variable-group variable create --group-id --name my.variable.name --value "`$(some-text)"
```
4. Notice how the variable actually gets added, but the closing paren is removed. You will also see the error "Failed to load python executable." The same thing happens for the `variable-group variable update` command.

**Expected behavior**
The variable is added or updated with the specified value including the closing paren and I do not receive an error.

**Screenshots**
![image](https://user-images.githubusercontent.com/7267334/85185221-b3b3e980-b258-11ea-8f6b-991a7446a0bd.png)

**Debug logs**
[debug.txt](https://github.com/Azure/azure-devops-cli-extension/files/4806970/debug.txt)

**Additional context**
Note that if I remove the dash from the variable value, then the following command works as expected;
```
az pipelines variable-group variable create --group-id --name my.variable.name --value '$(some text)'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.