-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
net: TestInterfacesWithNetsh failure in Italian version of Windows #14859
Comments
@alexbrainman, can we force the language on Windows with an environment variable or something? |
I don't know, i solved with the installation of english language pack. |
@bigslipper I am glad you solved your problem. But I was hoping that you could test me change https://go-review.googlesource.com/20865. Maybe you have another PC with Italian version of Windows. I would also like to know what GetConsoleOutputCP returns on your system - you should be able to insert some println in the test. Thank you. Alex |
CL https://golang.org/cl/20865 mentions this issue. |
@alexbrainman the GetConsoleOutputCP return 850, Parametri Ethernet interfacciaIfLUID : ethernet_0 Parametri Wi-Fi interfacciaIfLUID : wireless_0 Parametri Loopback Pseudo-Interface 1 interfacciaIfLUID : loopback_1 Parametri Connessione alla rete locale (LAN)* 2 interfacciaIfLUID : wireless_6 |
Thanks for checking. I was hoping GetConsoleOutputCP will return something different than 850, because my computer's GetConsoleOutputCP returns 850 too, but my netsh speaks English. Going by your answer, I take it this change https://go-review.googlesource.com/20865 does not fix your problem. Does it? Do you know of any other way to fix this issue? A particular Windows API we could call. Maybe some program that we could run to determine your netsh speaks Italian. Thank you. Alex |
Just run netsh and search for a few substrings to see if it's in English. No need to detect Italian, German, Japanese, etc. The existing isEnglish function only reports a boolean anyway. |
I had that idea. But I was hoping there is a more reliable way to do that. I will do that if nothing else. Alex |
I hope this helps you.
|
@hirochachacha are you suggesting we use echo or chcp to determine ifnewsh speaks English? But I would rather use Brad's suggestion. Alex |
You can get any output as English by
|
How would I use "chcp 437" (from a Go program) to make netsh output English if I am on non-English version of Windows? Alex |
For example:
If |
I will try that. Thank you. Alex |
CL https://golang.org/cl/21195 mentions this issue. |
Hi, from version 1.5.2 to 1.6 of GO the test net_windows_net.go fail, the problem was the exit of netsh command called in netshInterfaceIPShowInterface(). The output of command is in Italian so when it search
if bytes.HasPrefix(line, []byte("Interface ")) && bytes.HasSuffix(line, []byte(" Parameters")) {
return an empty slice because italian exit is "Interfaccia" and "Parametri".
This is output of building process:
---FAIL: TestInterfacesWithNetsh (2.22s)
net_windows_test.go:313: unexpected interface list ["Connessione alla rete locale (LAN)* 3:down" "Ethernet:up" "Loopback Pseudo-Interface 1:up" "Wi-Fi:d
own" "isatap.test.it:down"], want []
--- FAIL: TestInterfaceAddrsWithNetsh (1.61s)
net_windows_test.go:505: Ethernet: unexpected addresses list ["192.168.109.164/24" "fe80::3c96:b339:2c28:768f"], want []
net_windows_test.go:505: Loopback Pseudo-Interface 1: unexpected addresses list ["127.0.0.1/8" "::1"], want []
Alex
The text was updated successfully, but these errors were encountered: