Skip to content
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

UnicodeEncodeError: 'charmap' codec can't encode characters #65

Open
somnaewq opened this issue Jul 11, 2024 · 4 comments
Open

UnicodeEncodeError: 'charmap' codec can't encode characters #65

somnaewq opened this issue Jul 11, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@somnaewq
Copy link

somnaewq commented Jul 11, 2024

When I press execute in 1.5.1 I get the following error, 1.4.11 still works for me

使用语言/Use language:  en_US
2024-07-11 13:52:45.2121084 [W:onnxruntime:Default, onnxruntime_pybind_state.cc:1983 onnxruntime::python::CreateInferencePybindStateModule] Init provider bridge failed.
{'OPEN_IN_WEB': True}
NiceGUI ready to go on http://localhost:8001
RUN
Traceback (most recent call last):
  File "main.py", line 13, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "modules\utils\__init__.py", line 3, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "modules\utils\adb_utils.py", line 5, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "modules\utils\log_utils.py", line 86, in <module>
  File "modules\utils\log_utils.py", line 24, in __init__
  File "encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-3: character maps to <undefined>
Traceback (most recent call last):
  File "main.py", line 13, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "modules\utils\__init__.py", line 3, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "modules\utils\adb_utils.py", line 5, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "modules\utils\log_utils.py", line 86, in <module>
  File "modules\utils\log_utils.py", line 24, in __init__
  File "encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-3: character maps to <undefined>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 51, in <module>
  File "encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 21-27: character maps to <undefined>
[25200] Failed to execute script 'main' due to unhandled exception!
Process finished.

@sanmusen214
Copy link
Owner

sanmusen214 commented Jul 11, 2024

When I press execute in 1.5.1 I get the following error, 1.4.11 still works for me

I think this issue is caused by the character encoding when trying to log information in the GUI.
Try to double click the BAAH.exe to open BAAH1.5.1 (and maybe need to input the target config file name) but not execute it in the GUI, does it work?

@sanmusen214 sanmusen214 added the bug Something isn't working label Jul 11, 2024
@somnaewq
Copy link
Author

Yes, running directly from BAAH.exe works.

@sanmusen214
Copy link
Owner

Yes, running directly from BAAH.exe works.

OK, I will add another button in GUI to run BAAH in a new terminal (just like before in 1.4.11).

@sanmusen214
Copy link
Owner

You can download 1.5.2 and find "save and execute (terminal)” button in the gui.
Please leave this issue open, I'm figuring on proper encoding method of running BAAH in GUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants