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

Crash au lancement avec "UnicodeDecodeError: 'charmap' codec can't decode byte..." #102

Closed
laowantong opened this issue Nov 13, 2023 · 0 comments
Assignees
Labels

Comments

@laowantong
Copy link
Owner

Ce problème a été signalé par des utilisateurs de Windows dont la langue du système est l'anglais.

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\yohan\anaconda3\Scripts\mocodo.exe\__main__.py", line 7, in <module>
  File "C:\Users\yohan\anaconda3\Lib\site-packages\mocodo\__main__.py", line 329, in main
    run = Runner()
          ^^^^^^^^
  File "C:\Users\yohan\anaconda3\Lib\site-packages\mocodo\__main__.py", line 79, in __init__
    self.params = parsed_arguments()
                  ^^^^^^^^^^^^^^^^^^
  File "C:\Users\yohan\anaconda3\Lib\site-packages\mocodo\argument_parser.py", line 266, in parsed_arguments
    transformations = Transformations(default_params["language"])
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\yohan\anaconda3\Lib\site-packages\mocodo\argument_parser.py", line 59, in __init__
    template_data = json.loads(index_path.read_text())
                               ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\yohan\anaconda3\Lib\pathlib.py", line 1059, in read_text
    return f.read()
           ^^^^^^^^
  File "C:\Users\yohan\anaconda3\Lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 243: character maps to <undefined>

Un contournement consiste à passer l'encodage par défaut en UTF-8, puis à redémarrer :

region_set_3

En 2023, apparemment, le support d'UTF-8 par Microsoft est toujours en bêta 😜

Plus de détails pour arriver à cette fenêtre ici.


De mon côté, je vais forcer la lecture en UTF-8 plutôt que de m'en remettre à l'encodage par défaut du système.

@laowantong laowantong added the bug label Nov 13, 2023
@laowantong laowantong self-assigned this Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant