Skip to content

[Baldur's Gate 3]: Fix UnicodeEncodeError and ValueError#218

Merged
Holt59 merged 3 commits intoModOrganizer2:masterfrom
JonathanFeenstra:fix-bg3-errors
Apr 20, 2026
Merged

[Baldur's Gate 3]: Fix UnicodeEncodeError and ValueError#218
Holt59 merged 3 commits intoModOrganizer2:masterfrom
JonathanFeenstra:fix-bg3-errors

Conversation

@JonathanFeenstra
Copy link
Copy Markdown
Member

Reported by a tester on Discord:
imagen
imagen
According to this line:

<?xml version="1.0" encoding="UTF-8"?>

The XML file uses UTF-8 encoding, so that needs to be taken into account when writing the file.

The ValueError is caused by the path.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 the relative_to part.

@JonathanFeenstra
Copy link
Copy Markdown
Member Author

CC: @daescha

@daescha
Copy link
Copy Markdown
Contributor

daescha commented Apr 19, 2026

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.

@Holt59 Holt59 merged commit 67cdd4f into ModOrganizer2:master Apr 20, 2026
3 checks passed
@JonathanFeenstra JonathanFeenstra deleted the fix-bg3-errors branch April 20, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants