InvokeAI/invokeai
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 #6105, 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  #6129 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
..
app fix: use locale encoding 2024-04-04 15:30:47 +11:00
assets feat(api): chore: pydantic & fastapi upgrade 2023-10-17 14:59:25 +11:00
backend Update probe to always use cpu for loading models 2024-04-04 07:34:43 +11:00
configs fix(mm): add missing v2-midas-inference.yaml 2024-03-27 07:48:54 -04:00
frontend fix(ui): fix model name overflow 2024-04-04 08:03:30 +11:00
invocation_api feat(nodes): "ModelField" -> "ModelIdentifierField", add hash/name/base/type 2024-03-10 11:03:38 +11:00
version Run typegen, bump version 2024-04-02 10:14:39 -04:00
__init__.py Various fixes 2023-01-30 18:42:17 -05:00