wsl-path-converter
wsl-path-converter copied to clipboard
Documentation example escaping
If I copy and paste the examples, you give in the readme, I just get a ">" prompt since the \ is not escaped.
Hi, I am observing this issue in a build from the master branch. As per https://github.com/lamyj/wsl-path-converter/issues/3#issuecomment-597183972, this issue should have been fixed, but it still exists. I am using WSL2 with python 3.8.3.
$ wpc -u C:\users
Traceback (most recent call last):
File "/home/user/anaconda3/bin/wpc", line 8, in <module>
sys.exit(main())
File "/home/user/anaconda3/lib/python3.8/site-packages/wsl_path_converter/main.py", line 47, in main
print(converter(arguments.path))
File "/home/user/anaconda3/lib/python3.8/site-packages/wsl_path_converter/__init__.py", line 28, in convert_u
windows_root = find_root(linux_roots, windows_path, "\\")
File "/home/user/anaconda3/lib/python3.8/site-packages/wsl_path_converter/__init__.py", line 101, in find_root
raise Exception("No root found for {}".format(path))
Exception: No root found for C:users
From the last line, its seen that \ is removed.
$ wpc -u C:\\users
/mnt/c/users
$ wpc -u "C:\users"
/mnt/c/users
Escaping the \ or enclosing the path with " makes it work.
Maybe we should update the docs?