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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • JAVA版位图排序(算法珠玑开篇的例子)

    JAVA版位图排序(算法珠玑开篇的例子)

    2021年5月8日
  • 高并发下线程安全的单例模式(最全最经典)

    高并发下线程安全的单例模式(最全最经典)在所有的设计模式中,单例模式是我们在项目开发中最为常见的设计模式之一,而单例模式有很多种实现方式,你是否都了解呢?高并发下如何保证单例模式的线程安全性呢?如何保证序列化后的单例对象在反序列化后任然是单例的呢?这些问题在看了本文之后都会一一的告诉你答案,赶快来阅读吧!

    2022年5月16日
  • leetcode 颜色分类_leetcode72

    leetcode 颜色分类_leetcode72给定一个包含红色、白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色、白色、蓝色顺序排列。此题中,我们使用整数 0、 1 和 2 分别表示红色、白色和蓝色。示例 1:输入:nums = [2,0,2,1,1,0]输出:[0,0,1,1,2,2]示例 2:输入:nums = [2,0,1]输出:[0,1,2]示例 3:输入:nums = [0]输出:[0]示例 4:输入:nums = [1]输出:[1] 提示:n == num

    2022年8月8日
  • 基准测试框架JMH使用详解

    基准测试框架JMH使用详解JMH简介JMH即JavaMicrobenchmarkHarness,是Java用来做基准测试的一个工具,该工具由OpenJDK提供并维护,测试结果可信度高。基准测试Benchmark是测量、评估软件性能指标的一种测试,对某个特定目标场景的某项性能指标进行定量的和可对比的测试。项目中添加依赖创建一个基准测试项目,在项目中引入JMH的jar包,目前JMH的最新版本为1.23。以maven为例,依赖配置如下。<dependencies><dependency

    2022年7月11日
  • 简述51单片机的内部结构_51单片机的硬件结构及其作用

    简述51单片机的内部结构_51单片机的硬件结构及其作用【1.基本组成】单片机是在一块芯片中集成了CPU、RAM、ROM、定时/计数器和多功能I/O等计算机所需要的基本功能部件的大规模集成电路,又称MCU。51单片机内包含下列几个部件:一个8位CPU一个片内震荡器及时钟电路一个片内4KBROM程序存储器128字节RAM数据存储器可寻址64KB外部数据存储器和64KB外部程序存储空间的控制电路32条可编程的I/O线(4个8位并行I/O端口)两个16位的定时/计数器一个可编程全双工串行口5个中断源、两个优先级嵌套中断结构

    2022年10月4日
  • OA工作流的定义

    OA工作流的定义OA工作流就是建立于网络办公自动化基础上的事务行政审批,业务申请审批、公文、信息等的网上流转。OA工作流类别.OA工作流软件从不同的角度,有许多不同的分类方法,比如依据底层技术分类、依据任务传递机制分类、根据所实现的业务过程等,我们从用户角度出发,由于用户购买软件其最根本的出发点是改善管理转载于:https://www.cnblogs.com/jiang–nan/p/8664959.html…

    2022年6月23日

发表回复

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

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