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


相关推荐

  • vs2008 sp1有什么用_vss好用吗

    vs2008 sp1有什么用_vss好用吗VS2005SP1出来好长时间了,一直没有用到过,一个偶然机会从网上下载了一个权限控制系统需要SP1支持,这才下一下,安装过程是我至少目前遇到过最慢的。Windows好像也没这么慢,其中一些经验大家可以参考一下,省得再走弯路。解决只能创建WebSite,无法创建WebApplication项目的问题    微软的VisualStudio2005ServicePack1(S

    2022年10月5日
    0
  • 网页游戏设计经验谈「建议收藏」

    网页游戏设计经验谈「建议收藏」作者是网页游戏《古今东西》(www.ooplay.net)的设计者。这篇文章讲述了设计游戏3年中的感悟。 引言有这样一个故事。曾经有一段时期,地球上所有的人都是神,但是他们却无法无天,滥用神权。因此,众神之神的梵天决定,要把人的神性从他们身上取走,藏在他们永远也找不到的地方,让他们再也不能滥用自己的神权。“我们把它深埋在地下吧。”其他神说。“不,”梵天说,“因为他们会向下挖地,

    2022年6月1日
    24
  • django debug_eclipse使用debug调试

    django debug_eclipse使用debug调试介绍Django框架的调试工具栏使用django-debug-toolbar库,是一组可配置的面板,显示有关当前请求/响应的各种调试信息,点击时,显示有关面板内容的更多详细信息。应用1.安装

    2022年7月31日
    2
  • Python程序中for循环用法详解「建议收藏」

    Python程序中for循环用法详解「建议收藏」Python程序中for循环用法详解一个通用的序列迭代器,用于遍历任何有序的序列对象内的元素,可用于字符串、元组、列表和其它内置可迭代对象,以及通过类所创建的新对象。1、for循环语法格式:forexpressioninobject:      for_suiteelse:      else_suite2、for语法格式扩展:forexpressioninobject:     …

    2022年8月12日
    7
  • Java中级面试题及答案(120道Java中级面试题大汇总)[通俗易懂]

    Java中级面试题及答案(120道Java中级面试题大汇总)[通俗易懂]Java中级面试题及答案【最新版及答案,干货!!!这是一个中级Java面试系列题中的第一部分。这一部分论述了可变参数,断言,垃圾回收,初始化器,令牌化,日期,日历等等Java核心问题。Java中级面试永远是程序员迈向成功的第一个门槛,想要面试成功,各种面试题的洗礼是必不可少的,下面就来看看小编精心整理的一些java高级工程师面试题及答案吧。如果不背Java面试题的答案,肯定面试会挂!这套Java面试题大全,希望对大家有帮助哈~博主已将以下这些面试题整理成了一个Java面试手册,是PDF版的

    2022年6月15日
    42
  • treap模版_bartender模板

    treap模版_bartender模板#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusingnamespacestd;typedefintll;typedefunsignedlonglongu

    2025年7月22日
    0

发表回复

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

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