Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork939
Commitd5ed266
committed
Use bytes in bash.exe check; retest no-distro case
This removes text=True from the subprocess.run call, changing strliterals to bytes where appropriate and (less importantly) using"%r" instead of "%s" in log messages so it's clear that printingthe repr of a bytes object is, at least for now, intentional.The reason for this is that the encoding of error messages producedby running the WSL bash.exe, when it attempts but fails to use aWSL system, varies based on what error occurred. When no systemsare installed, the output can be decoded as UTF-8. When an errorfrom "deeper down" is reported, at least for Bash/Service errors,the output is encoded in UTF-16LE, and attempting to decode it asUTF-8 interleaves lots of null characters in the best case. With abytes object, loss of information is avoided, and it is clear oninspection that the output requires decoding.The most common case of such an error is *probably*: Insufficient system resources exist to complete the requested service. Error code: Bash/Service/CreateInstance/CreateVm/HCS/0x800705aaHowever, that is tricky to produce intentionally on some systems.To produce a test error, "wsl --shutdown" can be run repeatedlywhile a _WinBashStatus.check() call is in progress. This produces: The virtual machine or container was forcefully exited. Error code: Bash/Service/0x80370107Assuming the output always includes the text "Error code:", it maybe feasible to reliably detect which cases it is. This couldespecially improve the log message. But for now that is not done.In adddition to changing from text to binary mode, this commit alsotemporarily removes the setup-wsl step from the CI workflow again,to verify on CI that the text-to-binary change doesn't break theWslNoDistro case. Manual testing shows the other cases still work.1 parent7ff3cee commitd5ed266
2 files changed
+7
-12
lines changedLines changed: 0 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
38 |
| - | |
39 |
| - | |
40 |
| - | |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 | 38 |
| |
45 | 39 |
| |
46 | 40 |
| |
|
Lines changed: 7 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
94 | 94 |
| |
95 | 95 |
| |
96 | 96 |
| |
97 |
| - | |
| 97 | + | |
| 98 | + | |
98 | 99 |
| |
99 | 100 |
| |
100 |
| - | |
| 101 | + | |
101 | 102 |
| |
102 | 103 |
| |
103 | 104 |
| |
| |||
106 | 107 |
| |
107 | 108 |
| |
108 | 109 |
| |
109 |
| - | |
| 110 | + | |
110 | 111 |
| |
111 | 112 |
| |
112 | 113 |
| |
| |||
117 | 118 |
| |
118 | 119 |
| |
119 | 120 |
| |
120 |
| - | |
| 121 | + | |
121 | 122 |
| |
122 |
| - | |
| 123 | + | |
123 | 124 |
| |
124 |
| - | |
| 125 | + | |
125 | 126 |
| |
126 | 127 |
| |
127 | 128 |
| |
|
0 commit comments
Comments
(0)