[Baldur's Gate 3]: Fix UnicodeEncodeError and ValueError#218
Merged
Holt59 merged 3 commits intoModOrganizer2:masterfrom Apr 20, 2026
Merged
[Baldur's Gate 3]: Fix UnicodeEncodeError and ValueError#218Holt59 merged 3 commits intoModOrganizer2:masterfrom
Holt59 merged 3 commits intoModOrganizer2:masterfrom
Conversation
Member
Author
|
CC: @daescha |
Contributor
|
yes @JonathanFeenstra you appear to be correct that these paths are just for debug logging. I think the logic was I wanted it to produce paths that didn't have the censored user in them so I could copy and paste? I guess... forgetting now since that was six months ago and my commit message wasnt helpful, but regardless, it was nothing worth breaking users with alternative env's experience. I tested your change and everything looks good. Thank you for providing the fix 😌 @Holt59 this is ready to merge, IMO. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reported by a tester on Discord:


According to this line:
modorganizer-basic_games/games/baldursgate3/bg3_utils.py
Line 52 in 3262f22
The XML file uses UTF-8 encoding, so that needs to be taken into account when writing the file.
The
ValueErroris caused by thepath.relative_to(Path.home())calls, which assume that MO2 is installed in the user's home directory, but that's not always the case. These paths seem to only be used for debugging purposes, so I just removed therelative_topart.