AcademySoftwareFoundation / AcademySoftwareFoundation/rez

Pipe character issues on Windows.

Open
#752 8 comments 0 reactions 0 assignees View on GitHub
bug os:windows shell
Dominant language
Python
Stars
1.1k
Forks
374
Avg merge
9d 12h
Merged PRs (30d)
5

Description

Hi,

I'm testing Rez 2.47.2 and encountering issues with pipe character handling, this time and for a change, a picture:

![image](https://user-images.githubusercontent.com/99779/65846243-a76dc080-e399-11e9-9594-e589f978cf81.png)

This is quite a problematic one, we are passing regex patterns as arguments often and it just breaks now.

I can escape them like this to some degree:

```
C:\Users\thomas>rez-env cmd -- echo "Foo^|Bar"
Foo|Bar
```

But I could not get it to work with more complex invocations unfortunately. Assuming a **my-command.bat** file which does echo its arguments, i.e. `echo %*`, in the current working directory:

```
C:\Users\thomas>rez-env cmd -- my-command --argument-a --argument-b "C:\Users\thomas\My Directory" --argument-c "\bFoo\b|Bar-Plop|John-Plop|Doe-Plop"
'Bar-Plop' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\thomas>rez-env cmd -- my-command --argument-a --argument-b "C:\Users\thomas\My Directory" --argument-c "\bFoo\b^|Bar-Plop^|John-Plop^|Doe-Plop"
'Bar-Plop' is not recognized as an internal or external command,
operable program or batch file.
```

I could change `echo %*` to `echo "%*"` and it would work but if `echo` is instead a Python program which expects arguments it will break because of the double quotes as it will receive the whole line as a single argument instead of the granular arguments.

Contributor guide

Open the contributing guide

Research direction

Reproduce the Windows commands using `rez-env cmd --`, the `my-command.bat` example, and a Python program that receives arguments. Trace how pipe-containing regex arguments are handled across batch and Python invocations. Done means literal pipes remain within the intended argument boundaries without command splitting or requiring quotes that collapse all arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.