unicodeDecodeerror(python编译集成可执行程序)

错误如下:autoninja-Cout/Releasechrome”D:\dev\depot_tools\ninja.exe”-Cout/Releasechrome-j10ninja:Enteringdirectory`out/Release'[5/25580]ACTION//chrome/browser/resources/tab_search:build(//build/toolchain/win:win_clang_x64)FAILED:gen/chrome/

大家好,又见面了,我是你们的朋友全栈君。

错误如下:

autoninja -C out/Release chrome
"D:\dev\depot_tools\ninja.exe" -C out/Release chrome -j 10
ninja: Entering directory `out/Release'
[5/25580] ACTION //chrome/browser/resources/tab_search:build(//build/toolchain/win:win_clang_x64)
FAILED: gen/chrome/browser/resources/tab_search/tab_search.rollup.js gen/chrome/browser/resources/tab_search/build_manifest.json
D:/dev/depot_tools/bootstrap-2@3_8_10_chromium_17_bin/python3/bin/python3.exe ../../chrome/browser/resources/tools/optimize_webui.py --host tab-search.top-chrome --input gen/chrome/browser/resources/tab_search/preprocessed --out_folder gen/chrome/browser/resources/tab_search --depfile gen/chrome/browser/resources/tab_search/build.d --js_out_files tab_search.rollup.js --exclude chrome://resources/js/cr.m.js chrome://resources/mojo/mojo/public/js/bindings.js chrome://resources/mojo/mojo/public/mojom/base/time.mojom-webui.js fuse.js --external_paths chrome://resources/polymer/v3_0/|../../third_party/polymer/v3_0/components-chromium/ chrome://resources/|gen/ui/webui/resources/preprocessed/ --js_module_in_files tab_search.js --out-manifest gen/chrome/browser/resources/tab_search/build_manifest.json
Traceback (most recent call last):
  File "../../chrome/browser/resources/tools/optimize_webui.py", line 273, in <module>
    main(sys.argv[1:])
  File "../../chrome/browser/resources/tools/optimize_webui.py", line 253, in main
    manifest_out_path = _optimize(args.input, args)
  File "../../chrome/browser/resources/tools/optimize_webui.py", line 207, in _optimize
    bundled_paths = _bundle_v3(tmp_out_dir, in_path, out_path,
  File "../../chrome/browser/resources/tools/optimize_webui.py", line 183, in _bundle_v3
    output = f.read()
UnicodeDecodeError: 'gb18030' codec can't decode byte 0xa2 in position 133561: illegal multibyte sequence
[7/25580] ACTION //chrome/browser/resources/new_tab_page:optimized_js(//build/toolchain/win:win_clang_x64)
FAILED: gen/chrome/browser/resources/new_tab_page/new_tab_page.rollup.js gen/chrome/browser/resources/new_tab_page/lazy_load.rollup.js gen/chrome/browser/resources/new_tab_page/shared.rollup.js gen/chrome/browser/resources/new_tab_page/build_manifest.json
D:/dev/depot_tools/bootstrap-2@3_8_10_chromium_17_bin/python3/bin/python3.exe ../../chrome/browser/resources/tools/optimize_webui.py --host new-tab-page --input gen/chrome/browser/resources/new_tab_page/preprocessed --out_folder gen/chrome/browser/resources/new_tab_page --depfile gen/chrome/browser/resources/new_tab_page/optimized_js.d --js_out_files new_tab_page.rollup.js lazy_load.rollup.js shared.rollup.js --exclude chrome://resources/js/cr.m.js chrome://resources/mojo/mojo/public/js/bindings.js chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js chrome://resources/mojo/mojo/public/mojom/base/big_buffer.mojom-lite.js chrome://resources/mojo/mojo/public/mojom/base/string16.mojom-lite.js chrome://resources/mojo/mojo/public/mojom/base/text_direction.mojom-lite.js chrome://resources/mojo/mojo/public/mojom/base/time.mojom-lite.js chrome://resources/mojo/mojo/public/mojom/base/unguessable_token.mojom-lite.js chrome://resources/mojo/skia/public/mojom/skcolor.mojom-lite.js chrome://resources/mojo/skia/public/mojom/skcolor.mojom-webui.js chrome://resources/mojo/url/mojom/origin.mojom-lite.js chrome://resources/mojo/url/mojom/url.mojom-lite.js new_tab_page.mojom-lite.js realbox/realbox.mojom-lite.js promo_browser_command.mojom-lite.js modules/drive/drive.mojom-lite.js modules/task_module/task_module.mojom-lite.js foo.mojom-lite.js modules/cart/chrome_cart.mojom-lite.js --external_paths chrome://resources/polymer/v3_0/|../../third_party/polymer/v3_0/components-chromium/ chrome://resources/|gen/ui/webui/resources/preprocessed/ --js_module_in_files new_tab_page.js lazy_load.js --out-manifest gen/chrome/browser/resources/new_tab_page/build_manifest.json
Traceback (most recent call last):
  File "../../chrome/browser/resources/tools/optimize_webui.py", line 273, in <module>
    main(sys.argv[1:])
  File "../../chrome/browser/resources/tools/optimize_webui.py", line 253, in main
    manifest_out_path = _optimize(args.input, args)
  File "../../chrome/browser/resources/tools/optimize_webui.py", line 207, in _optimize
    bundled_paths = _bundle_v3(tmp_out_dir, in_path, out_path,
  File "../../chrome/browser/resources/tools/optimize_webui.py", line 183, in _bundle_v3
    output = f.read()
UnicodeDecodeError: 'gb18030' codec can't decode byte 0xa2 in position 220443: illegal multibyte sequence
[14/25580] ACTION //chrome/browser/resources/settings:build(//build/toolchain/win:win_clang_x64)
ninja: build stopped: subcommand failed.

参考的网址

https://w-run.com/other/Chromium1/
https://www.huaweicloud.com/articles/f3dc1b1666cf4c11c0c7e5824317f1c0.html

解决方法:

修改src/chrome/browser/resources/tools/optimize_webui.py下,

for bundled_file in bundled_paths:
    with open(bundled_file, 'r') as f:
      output = f.read()
      assert "<if expr" not in output, \
          'Unexpected <if expr> found in bundled output. Check that all ' + \
          'input files using such expressions are preprocessed.'

改为

for bundled_file in bundled_paths:
    with open(bundled_file, 'r',  encoding='gb18030', errors='ignore') as f:
      output = f.read()
      assert "<if expr" not in output, \
          'Unexpected <if expr> found in bundled output. Check that all ' + \
          'input files using such expressions are preprocessed.'

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/128788.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 将图像转换为8位通道_imagej像素和毫米转换

    将图像转换为8位通道_imagej像素和毫米转换一背景遥感图像一般像素深度比较高,基本的就是unit16了,但是如果想在OpenCV中正确使用,而且不丢失数据RGB三通道信息,就需要转为unit8才能进行其他分析。二分析unit16的图像最大值为216-1=65535,而OpenCV中的图像最大值为28-1=255,当大于255时会自动变为255,这样数据信息就丢失了。下面代码采用的方式是线性缩放,将0到65535的数值线性缩…

    2022年9月17日
    0
  • linux SIGABRT信号

    自己写的程序启动时偶尔会被SIGABRT信号杀死。故查看下SIGABRT的用法。SIGABRT是中止一个程序,它可以被捕捉,但不能被阻塞。处理函数返回后,所有打开的文件描述符将会被关闭,流也会被flush。程序会结束,有可能的话还会coredump。当程序调用abort(3)时,该进程会向自己发送SIGABRT信号。所以,SIGABRT一般用于信号中一些关键的处理,assert失败时也

    2022年4月8日
    308
  • webstorm激活码最新2021(最新序列号破解)

    webstorm激活码最新2021(最新序列号破解),https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月19日
    159
  • Arcgis api for JavaScript下载及部署(IIS和Tomcat)

    Arcgis api for JavaScript下载及部署(IIS和Tomcat)目录一,各版本下载地址二,ArcGISAPIForJavaScript3.17本地部署(IIS)2.1修改相应的js文件(2个文件)2.2将修改好的函数库复制到指定位置2.3测试ArcGISAPIForJavaScript函数库是否安装成功三,Tomcat部署3.1修改2个js文件3.2将修改好的函数库复制到指定位置3.3测试ArcGI…

    2022年6月3日
    171
  • C/C++ int数组初始化

    C/C++ int数组初始化一、一维数组C/C++初始化静态数组intarray[100]; //定义了数组array,但并未对数组初始化;静态数组intarray[100]={0}; //定义了数组array,并将数组元素全部初始化为0;静态数组intarray[100]={1}; //定义了数组array,并将数组第一个元素初始化为1,后面99个元素初始化为0;静态数组intarr…

    2022年7月18日
    89
  • netty权威指南学习

    netty权威指南学习1、Bio工程结构maven工程文件结构:│nettyArticle.iml│pom.xml│├─.idea│compiler.xml│misc.xml│vcs.xml│workspace.xml│├─src│├─main││├─java│││└─com│││└─jad…

    2022年10月2日
    0

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号