-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Windows Version
10.0.26200.7171
WSL Version
2.6.1.0
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
6.6.87.2
Distro Version
6.6.87.2-microsoft-standard-WSL2
Other Software
Any available TOML CLI parser such as
a. https://github.com/blinxen/tomli
b. https://github.com/gnprice/toml-cli
Repro Steps
- Follow a setup of wsl.conf on https://learn.microsoft.com/en-us/windows/wsl/wsl-config
a. Example wsl.conf:
[user]
default=user
-
Install a TOML parser like tomli, or toml-cli.
a.sudo apt-get install cargo
b.sudo cargo install tomliORsudo cargo install toml-cli -
Try to read/write with TOML parser /etc/wsl.conf with illegal strings.
a.sudo toml get /etc/wsl.conf user.default
OR
b.sudo tomli set -if /etc/wsl.conf user.default user
See error regarding the TOML requirement for a string value to be quoted. Such as:
toml: TOML parse error at line 2, column 9
|
2 | default=user
| ^
Unexpected `u`
Expected quoted string
OR
The provided TOML document has an invalid syntax:
TOML parse error at line 2, column 9
|
2 | default=user
| ^^^^
string values must be quoted, expected literal string
Expected Behavior
I have expected the WSL config files to follow an up-to-date specification for TOML such that command line tools may be used for key lookups or writes; strings must be required to be quoted as defined here: https://toml.io/en/v1.0.0#string
Actual Behavior
The actual behavior can be split in two parts:
a. Both /etc/wsl.conf and %USERPROFILE%/.wslconfig may allow for unquoted strings.
b. The Microsoft provided documentation (https://learn.microsoft.com/en-us/windows/wsl/wsl-config) contains multiple examples of strings that are not quoted.
Diagnostic Logs
No response