diff --git a/patches/series b/patches/series index b1c2eb92..4e96b0ba 100644 --- a/patches/series +++ b/patches/series @@ -2,6 +2,7 @@ upstream-fixes/glue_core_pools.patch upstream-fixes/hardware_destructive_interference_size.patch upstream-fixes/missing-dependencies.patch upstream-fixes/fix-crash-without-enterprise-cloud-content-analysis.patch +upstream-fixes/fix-python-codecs-deprecation.patch core/inox-patchset/0001-fix-building-without-safebrowsing.patch core/inox-patchset/0003-disable-autofill-download-manager.patch diff --git a/patches/upstream-fixes/fix-python-codecs-deprecation.patch b/patches/upstream-fixes/fix-python-codecs-deprecation.patch new file mode 100644 index 00000000..0f152998 --- /dev/null +++ b/patches/upstream-fixes/fix-python-codecs-deprecation.patch @@ -0,0 +1,39 @@ +From 9c7aa2956eebd3f739dc9f60d041923cdb9ffa06 Mon Sep 17 00:00:00 2001 +From: jj +Date: Thu, 06 Nov 2025 09:27:04 -0800 +Subject: [PATCH] Remove unneeded codecs usage in mojom_parser + +Python >=3.14 loudly complains on every mojom_parser use, with: + +DeprecationWarning: codecs.open() is deprecated. Use open() instead. + +`codecs` has not been useful for a long time, so let's drop it, +and simply call open() instead. + +Change-Id: Iaf4ab7bcdefb4c2b31aa825bac5d79970db0ba46 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7123066 +Reviewed-by: Tom Sepez +Commit-Queue: Oksana Zhuravlova +Reviewed-by: Oksana Zhuravlova +Cr-Commit-Position: refs/heads/main@{#1541277} +--- + +--- a/mojo/public/tools/mojom/mojom_parser.py ++++ b/mojo/public/tools/mojom/mojom_parser.py +@@ -12,7 +12,6 @@ generate usable language bindings. + + import argparse + import builtins +-import codecs + import errno + import json + import logging +@@ -180,7 +179,7 @@ def _CollectAllowedImportsFromBuildMetad + + # multiprocessing helper. + def _ParseAstHelper(mojom_abspath, enabled_features): +- with codecs.open(mojom_abspath, encoding='utf-8') as f: ++ with open(mojom_abspath, encoding='utf-8') as f: + ast = parser.Parse(f.read(), mojom_abspath) + conditional_features.RemoveDisabledDefinitions(ast, enabled_features) + return mojom_abspath, ast