git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: BUG: git bash / python interaction with absolute paths as environment variables in Windows

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 7, 2021, 21:39 UTC
Message-ID
<nycvar.QRO.7.76.6.2112072235400.90@tvgsbejvaqbjf.bet>
In-Reply-To
<CAHeq4YxktibxMBnMLwEq9Nvsgw0UqCrjW2WPcerJCM4mXKxiEw@mail.gmail.com>
Hi Leland,
On Mon, 6 Dec 2021, Leland Weathers wrote:
> Issue: Using Git Bash for Windows (2.34.1-64) and Python 3.9.9, a git
> path is incorrectly prepended to environment variables in Python code.

From Git for Windows' [Release Notes' "Known Issues" section](https://github.com/git-for-windows/build-extra/blob/master/ReleaseNotes.md#known-issues):

	* If you specify command-line options starting with a slash,
	  POSIX-to-Windows path conversion will kick in converting e.g.
	  "`/usr/bin/bash.exe`" to "`C:\Program Files\Git\usr\bin\bash.exe`".
	 When that is not desired -- e.g.
	 "`--upload-pack=/opt/git/bin/git-upload-pack`" or "`-L/regex/`" --
	 you need to set the environment variable `MSYS_NO_PATHCONV`
	 temporarily, like so:
	 > `MSYS_NO_PATHCONV=1 git blame -L/pathconv/ msys2_path_conv.cc`
	 Alternatively, you can double the first slash to avoid
	 POSIX-to-Windows path conversion, e.g. "`//usr/bin/bash.exe`".

Those release notes are shown by default when you install Git for Windows, and they are also accessible via the Start Menu as "Git Release Notes".

Show 5 quoted lines
> [... snip ...]
>
> In both cases I am using the same Python virtual environment. Other
> environment variables (e.g. non-absolute directory paths) appear to be
> read correctly. I'm assuming that this is a git issue given the
Premature end-of-mail?

Ciao, Johannes

Previous: Leland Weathers
Message 4 of 4 in “BUG: git bash / python interaction with absolute paths as environment variables in Windows”
  1. Leland WeathersDec 7, 2021
  2. Eric SunshineDec 7, 2021
  3. Leland WeathersDec 7, 2021
  4. Johannes SchindelinDec 7, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.