Skip to content

os/exec: PATH in windows ErrNotFound is not escaped #38994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xhit opened this issue May 11, 2020 · 2 comments
Closed

os/exec: PATH in windows ErrNotFound is not escaped #38994

xhit opened this issue May 11, 2020 · 2 comments

Comments

@xhit
Copy link
Contributor

xhit commented May 11, 2020

What version of Go are you using (go version)?

$ go version
1.14.2

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\sdelacruz\AppData\Local\go-build
set GOENV=C:\Users\sdelacruz\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\sdelacruz\Documents\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Users\sdelacruz\sdk\go1.14.2
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\sdelacruz\sdk\go1.14.2\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\sdelacruz\Documents\go\src\sdi\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\SDELAC~1\AppData\Local\Temp\go-build038950518=/tmp/go-build -gno-record-gcc-switches 

What did you do?

package main

import (
	"log"
	"os/exec"
	
)

func main() {
	cmd := exec.Command("pin", "google.com")
	err := cmd.Start()
	if err != nil {
		log.Fatal(err)
	}
}

What did you expect to see?

exec: "pin": executable file not found in %PATH%

What did you see instead?

exec: "pin": executable file not found in %!P(MISSING)ATH%!(NOVERB)

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/233198 mentions this issue: os/exec: escape percent literal for Windows PATH

@xhit
Copy link
Contributor Author

xhit commented May 11, 2020

Ignore the issue. I used a custom log package by mistake.

@xhit xhit closed this as completed May 11, 2020
@golang golang locked and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants