Open dr2chase opened 9 years ago
For background on this change see http://golang.org/issue/3021 and http://golang.org/cl/5674043 . In the latter, Russ said "We can exclude them now and relent if people complain. I propose to exclude control characters, spaces, invalid UTF-8, and backslash and see what happens."
@rsc
True, but note that there are no spaces in the import path of the Go test case itself, and the user may not have any control over that name. We've also taken care to avoid this problem in the usual case -- notice that "go run main.go" processes the import without complaint. This looks more like an artifact than a policy, but it's an artifact that appears if someone attempts a standard go clone+build at a path name with a space in it.
Even if it is a policy, I don't think it makes sense to exclude spaces. Windows/Linux/Mac treat spaces unexceptionally. I ran a find command on the root of my (relatively fresh Mac laptop) file system and found over 1000 directories with a space in their name, while #$@^%~:;=+?|"`'{}[]<>,*\ combined appeared in only 44 directory names. 28 had ( and 28 had ) -- probably the same 28.
The bug only affects people or programs that:
That's a lot of conditions. It's true that fixedbugs/bug248.go runs into this, as does fixedbugs/bug369.go, but probably the fix should be to correct those tests, not to make larger changes.
Note that the go command does work fine, because it arranges to use a sanitized version of the local directory in the path to the compiled artifacts, and it instructs the compiler to use that sanitized version with -D.
We should still fix the tests, but this is not blocking any release.
probably the fix should be to correct those tests, not to make larger changes.
Retitled accordingly.
Go version:
I did:
I expected to see a successful build and test.
Instead I saw:
and a similar failure with bug369.go . My workaround is to rename "Google Drive" to "GoogleDrive" (and correct external references to the original name).
Small reproducer (can copy and paste into shell):
This produces the error:
Ordinary compilation works fine: