-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rust parsing error on saves with accented names; also with C.A.R.E. country #126
Comments
Unicode error? Also, an "=" error below
In leader names too:
Replacing all the á makes parsing the save work. Second issue. If you replace all the
Yes, that's a name of |
I should have time to take a look at this sometime in the next few days |
Looks like the unicode error was just a bug in the debugging code, which tries to print the first 150 bytes without considering char boundaries. So that isn't an issue in the release, which has that debugging disabled. Fixed by making the slice char-boundary sensitive
|
Add an updated vanilla save from 3.10.4. This specifically tests both accented characters and names literally `=`. Modifies the test case to remove all *.db files output by the test.
Add an updated vanilla save from 3.10.4. This specifically tests both accented characters and names literally `=`. Modifies the test case to remove all *.db files output by the test. Uses temporary directories for save tests and organizes test saves a bit more.
Commit a8bab1e breaks parsing a couple saves of mine, in the Rust portion.
á
in names=
(see first comment)3.10.4 save (Linux; from Observer mode)(rename to .sav):
kaanvisamfriendship3_2508.07.01.zip
Old save (original report; I don't believe it was in Observer mode):
nexitronawareness4_2948.03.14.zip:
Repro - using docker for isolation
docker run -it forbiddenlake/stellaris-dashboard:v6-debian-bookworm-py3.11 bash
In this container, run:
Outside the container (in another window), copy the offending save in (remember to rename it) with something like the following, where 98a4b7dd6cb4 is the id of the container you just ran:
docker cp /syncthing/stellaris-saves/nexitronawareness4_-920922254/2948.03.14.sav 98a4b7dd6cb4:/home/stellaris/stellaris-dashboard/test/saves/nexitronawareness_1329922464/
Back in the container, run:
pytest test/parser_test.py -k "test_real_save" -s
This fails with:
FAILED test/parser_test.py::test_real_save - ValueError: Failed to parse /home/stellaris/stellaris-dashboard/test/saves/nexitronawareness_1329922464/2948.03.14.sav: Failed to parse save gamestate
Next, check out the previous commit and rebuild the rust parser:
And rerun:
pytest test/parser_test.py -k "test_real_save" -s
The parsing succeeds.
Aside: A later commit (7cabf08) contains updates that will prevent parsing this save file for a different reason, which is fixed in #124.
I don't know Rust at all to debug this further, so I'm submitting this. cc @MichaelMakesGames
People do run old versions of the game, so I think keeping backwards compatibility is good if feasible.
The text was updated successfully, but these errors were encountered: