hedronvision / bazel-compile-commands-extractor

Goal: Enable awesome tooling for Bazel users of the C language family.
Other
689 stars 114 forks source link

UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 16: illegal multibyte sequence #138

Closed markrenChina closed 1 year ago

markrenChina commented 1 year ago

windows11 run : bazel run @hedron_compile_commands//:refresh_all then print:

Starting local Bazel server and connecting to it...
INFO: Analyzed target @hedron_compile_commands//:refresh_all (37 packages loaded, 184 targets configured).
INFO: Found 1 target...
Target @hedron_compile_commands//:refresh_all up-to-date:
  bazel-bin/external/hedron_compile_commands/refresh_all.py                                                                          
  bazel-bin/external/hedron_compile_commands/refresh_all.exe                                                                         
  bazel-bin/external/hedron_compile_commands/refresh_all.zip                                                                         
INFO: Elapsed time: 4.536s, Critical Path: 0.03s
INFO: 1 process: 1 internal.                                                                                                         
INFO: Build completed successfully, 1 total action                                                                                   
INFO: Running command line: bazel-bin/external/hedron_compile_commands/refresh_all.exe
Traceback (most recent call last):
  File "C:\Users\Ushop\AppData\Local\Temp\Bazel.runfiles_lcswg6ox\runfiles\hedron_compile_commands\refresh_all.py", line 1037, in <module>
    _ensure_gitignore_entries_exist()
  File "C:\Users\Ushop\AppData\Local\Temp\Bazel.runfiles_lcswg6ox\runfiles\hedron_compile_commands\refresh_all.py", line 1005, in _ensure_gitignore_entries_exist
    lines = [l.rstrip() for l in gitignore]
  File "C:\Users\Ushop\AppData\Local\Temp\Bazel.runfiles_lcswg6ox\runfiles\hedron_compile_commands\refresh_all.py", line 1005, in <listcomp>
    lines = [l.rstrip() for l in gitignore]
UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 16: illegal multibyte sequence

How to solve this problem?

markrenChina commented 1 year ago

This issue is due to the presence of Chinese characters in. getignore. I solved it myself