2

Did someone experience this?

$ echo "import sys; print(sys.argv)" > test.py
$ python test.py test /dev/de
['test.py', 'test', 'C:/Program Files/Git/dev/de']

Gitbash is adding the C:/Program Files/Git prefix when the command argument is a posix path, for my case the workaround is to use double slash //dev/de, but I am wondering if that is a misconfiguration or if it could be solved somehow.

Berthin
  • 189
  • 2
  • 12
  • I wonder as well. The same thing yesterday confused me for hours until only today I noticed what's really happening. I was calling `aws ssm get-parameter --name "/myapp/testenv/foobar/keyname"` to get some data from AWS ParameterStore, and it kept saying "parameter not found" even though just a second earlier I got that `/myapp/testenv/foobar/keyname` from AWS API itself. It turned out that Git Bash was converting `/myapp/testenv/foobar/keyname` into `C:/Program Files/Git/myapp/testenv/foobar/keyname`. Have you found any solution other than // ? – quetzalcoatl Jul 05 '23 at 07:54
  • nvm, found a duplicate with answers – quetzalcoatl Jul 05 '23 at 07:57
  • Does this answer your question? [Git Bash - string parameter with '/' at start is being expanded to a file path. How to stop this?](https://stackoverflow.com/questions/54258996/git-bash-string-parameter-with-at-start-is-being-expanded-to-a-file-path) – quetzalcoatl Jul 05 '23 at 07:58
  • Another one, 8yrs older https://stackoverflow.com/questions/7250130/how-to-stop-mingw-and-msys-from-mangling-path-names-given-at-the-command-line – quetzalcoatl Jul 05 '23 at 08:37
  • See also [MSYS docs](https://www.msys2.org/docs/filesystem-paths/#automatic-unix-windows-path-conversion) that explain the path conversion, and how to control what gets converted (especially the MSYS2_ARG_CONV_EXCL/MSYS2_ENV_CONV_EXCL for fine-grained control, but it doesn't mention total MSYS_NO_PATHCONV switch, so dear reader in the future - do a bit of research to see if it's compatible to your env) – quetzalcoatl Jul 05 '23 at 08:52

0 Answers0