Update settings.py line 819#6263
Conversation
Replace "\" with "/" when reading the host.yaml. Because many users just copy paths containing "\" then complain when it doesn't work.
|
This change is not safe. Backslashes may very well be used inside the host.yaml either for escapes or simply things other than paths where they should not be changed to forward slashes. Even if we could do this perfectly, I don't think that we should be accepting invalid yaml syntax and thus working with a pseudo-yaml format. Also are you sure that this issue is caused by people copying paths? I'm pretty sure I've seen people run into this who don't even know what the host.yaml is, and in fact copying Windows paths would work so long as you don't add the extra quotes around it (depending on if the copy itself does that). I think this is happening for some people when added by a file dialog, but I'm not sure how. |
|
I wrote copying, but I don't know whether it's copying or the file dialog causing this. I didn't see how the dialog could be the problem so assumed it was user's copying a path incorrectly. Would it make sense to apply a simple .replace to the browse function of the FolderPath class instead? If the file dialog is causing this issue, that should catch the issue before writing to the host.yaml? Although, I suppose some madmen could have "\" in their directory names... |
What is this fixing or adding?
Replace "\" with "/" when reading the host.yaml. Because many users just copy paths containing "\" then complain when it doesn't work.
How was this tested?
Loaded host.yaml containing the following example paths for functionality:
"\\mnt\\disk1\\SteamLibrary\\steamapps\\common\\Total War WARHAMMER III"
"\mnt\disk1\SteamLibrary\steamapps\common\Total War WARHAMMER III"
"/mnt/disk1/SteamLibrary/steamapps/common/Total War WARHAMMER III"
All 3 do not throw errors and work identically.