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.'

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

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

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • PHP环境手动搭建教程

    PHP环境手动搭建教程Windows操作系统下手动搭建PHP环境,新手站长网是以php5.6+MySQL5.6+Apache2.4版本的组合来搭建环境:windows系统手动搭建PHP环境手动安装PHP环境比较麻烦,新手站长网先帮大家梳理下:版本搭配:php5.6+MySQL5.6+Apache2.4 大致流程概述:①下载PHP、MySQL和Apache三款软件;②安装MySQL数据库;③安装和配置Apa…

  • 2020-10-24 今年的1024

    2020-10-24 今年的1024作为一个伪程序员,写下自己的感受吧1.想靠编程这个饭碗吃饭,就要把这个技术搞扎实,说其他都都没有用;2.找到自己的用武之地,有自己的特点,有自己的能力才可以。3.坚持每天学习,每天总结,这是一生的好习惯【我是做不到】;4.考虑自己的年龄,找到自己年龄段该有的能力,该做的事情;…

  • 4个基本不等式的公式高中_基本不等式公式四个叫什么名字「建议收藏」

    4个基本不等式的公式高中_基本不等式公式四个叫什么名字「建议收藏」展开全部叫做平方平均数、算术平均数、几何平均数、调和平均数1.平方平均数:又名均方根(RootMeanSquare),英文62616964757a686964616fe78988e69d8331333431376632缩写为RMS。它是2次方的广义平均数的表达式,也可称为2次幂平均数。英文名为,一般缩写成RMS。2.算术平均数:又称均值,是统计学中最基本、最常用的一种平均指标,分为简单算术平均…

  • Hook技术简单介绍

    Hook技术简单介绍Hook主要就是通过一定手段在程序执行过程中进行干预。IATHook篡改MessageBox借用accills的例子#include&lt;windows.h&gt;#include&lt;stdio.h&gt;#include&lt;imagehlp.h&gt;#pragmacomment(lib,"imagehlp.lib")//以MessageBoxA的…

  • sublime text激活码【2021最新】

    (sublime text激活码)最近有小伙伴私信我,问我这边有没有免费的intellijIdea的激活码,然后我将全栈君台教程分享给他了。激活成功之后他一直表示感谢,哈哈~IntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,下面是详细链接哦~https://javaforall.cn/100143.htmlML…

  • std::thread 不 join

    std::thread 不 join

发表回复

您的电子邮箱地址不会被公开。

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