InvokeAI/installer/lib
psychedelicious 8c15d14099 fix: use locale encoding
We have had a few bugs with v4 related to file encodings, especially on Windows.

Windows uses its own character encodings instead of `utf-8`, often `cp1252`. Some characters cannot be decoded using `utf-8`, causing `UnicodeDecodeError`.

There are a couple places where this can cause problems:
- In the installer bootstrap, we install or upgrade `pip` and decode the result, using `subprocess`.

  The input to this includes the user's home dir. In , the user had one of the problematic characters in their username. `subprocess` attempts and fails to decode the username, which crashes the installer.

  To fix this, we need to use `locale.getpreferredencoding()` when executing the command.
- Similarly, in the model install service and config class, we attempt to load a yaml config file. If a problematic character is in the path to the file (which often includes the user's home dir), we can get the same error.

  One example is   in which the models.yaml migration fails.

  To fix this, we need to open the file with `locale.getpreferredencoding()`.
2024-04-04 15:30:47 +11:00
..
__init__.py doc updates; clean up install directory 2023-02-07 16:35:22 -05:00
installer.py fix: use locale encoding 2024-04-04 15:30:47 +11:00
main.py tidy(installer): remove no-op --version CLI arg of installer 2024-03-26 14:48:29 +11:00
messages.py feat(installer): remove extra GPU options 2024-04-04 08:43:17 +11:00