Closed Klaboe closed 3 years ago
It is TOML format rules (https://toml.io/en/ - check the section "Powerful strings"):
\N
combinations are converted to characters, and \uNNNN
are converted to symbols with unicode codepoint NNNN
It looks like \U
in the path is parsed as hexadecimal escape code start, but the next s
is not a hexadecimal digit, so it raises an error about incorrect hexadecimal number.
So, there are three solutions:
filename = 'c:\Users\user\todo.txt'
filename = "c:\\Users\\user\\todo.txt"
filename = "c:/Users/user/todo.txt"
I'll go with the single-quotes.
But i would maybe mention this in the documentation somewhere. Both what toml is (it was new to me, and for some reason it didn't connect the file-ending to a specific language in this instance 🤦♂️) and also that this is a ...caveat with specifying filepaths/names on windows 👍
But i would maybe mention this in the documentation somewhere
I agree, it makes sense. I think the best place is the comment inside the configuration file that explains what filename
options is. Or/and in the very beginning of the example configuration file.
I reopen the issue to not forget updating the docs.
I think the best place is the comment inside the configuration file
Agreed; this makes sense.
(...) that explains what filename options is. Or/and in the very beginning of the example configuration file.
Why not both? I would, at the start, mention the toml part (and perhaps the url you linked me), and then explain the caveats above the filename-part 👍
When i tried to specify a global filename for where to store the todo.txt like this:
filename = "C:\Users\<my-username>\Apps\ttdl\todo.txt"
i got this error
Failed to parse config file: Error { inner: ErrorInner { kind: InvalidHexEscape('s'), line: Some(67), col: 16, message: "", key: [] } }
And it used default values.
When i changed from double quotes to single quotes:
filename = 'C:\Users\<my-username>\Apps\ttdl\todo.txt'
it seems to work as expected.
Using Win10 Powershell 7.1.1 ttdl v1.0.0