in Windows, in NCS v2.9.0, compile error log "UnicodeDecodeError: 'cp950' codec can't decode byte 0xe2 in position 44:"

Hi, 

    Install NCS SDK v.2.9.0 in MAC by tool manager, compile SDK sample code by VSCode, OK

    However, install NCS SDK v2.9.0 in Windows by tool manager, compile SDK sample code with error: 

   

CMake Error at C:/ncs/v2.9.0/zephyr/cmake/modules/boards.cmake:196 (message):
  Error finding board: nrf52840dk

  Error message: Traceback (most recent call last):

    File "C:\ncs\v2.9.0\zephyr\scripts\list_boards.py", line 469, in <module>
      dump_v2_boards(args)
    File "C:\ncs\v2.9.0\zephyr\scripts\list_boards.py", line 416, in dump_v2_boards
      boards = find_v2_boards(args)
               ^^^^^^^^^^^^^^^^^^^^
    File "C:\ncs\v2.9.0\zephyr\scripts\list_boards.py", line 341, in find_v2_boards
      b, e = load_v2_boards(args.board, board_yml, systems)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\ncs\v2.9.0\zephyr\scripts\list_boards.py", line 230, in load_v2_boards
      b = yaml.load(f.read(), Loader=SafeLoader)
                    ^^^^^^^^

  UnicodeDecodeError: 'cp950' codec can't decode byte 0xe2 in position 44:
  illegal multibyte sequence

However, the NCS v2.8.0 works well in the same windows PC environment.

Could you help to solve the ""UnicodeDecodeError: 'cp950' codec can't decode byte 0xe2 in position 44:" issues,  thanks!

Best Regards

Frank

Parents
  • Hi, 

    I have the same error, and use the "west boards" command can reproduce the problem. I guess it may just happen in double-byte Windows environment.

    (v2.9.0) C:\ncs\v2.9.0> west boards
    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:\ncs\toolchains\b620d30767\opt\bin\Scripts\west.exe\__main__.py", line 7, in <module>
      File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\west\app\main.py", line 1085, in main
        app.run(argv or sys.argv[1:])
      File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\west\app\main.py", line 244, in run
        self.run_command(argv, early_args)
      File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\west\app\main.py", line 505, in run_command
        self.run_extension(args.command, argv)
      File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\west\app\main.py", line 654, in run_extension
        self.cmd.run(args, unknown, self.topdir, manifest=self.manifest,
      File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\west\commands.py", line 194, in run
        self.do_run(args, unknown)
      File "C:\ncs\v2.9.0\zephyr\scripts\west_commands\boards.py", line 100, in do_run
        for board in list_boards.find_v2_boards(args).values():
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\ncs\v2.9.0\zephyr\scripts\list_boards.py", line 341, in find_v2_boards
        b, e = load_v2_boards(args.board, board_yml, systems)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\ncs\v2.9.0\zephyr\scripts\list_boards.py", line 230, in load_v2_boards
        b = yaml.load(f.read(), Loader=SafeLoader)
                      ^^^^^^^^
    UnicodeDecodeError: 'cp950' codec can't decode byte 0xe2 in position 44: illegal multibyte sequence
    
    (v2.9.0) C:\ncs\v2.9.0>

  • Hi,

    I try to build NCS v2.9.0 sample in English Win10 virtual machine, it can build successfully, so the root cause is double-byte Win10 environment.

Reply Children
Related