patches/upstream-fixes: fix warning when building with py3.14 (#410)

This commit is contained in:
jj
2025-11-07 10:16:07 +01:00
committed by GitHub
parent e3bcfa4148
commit ee6294e217
2 changed files with 40 additions and 0 deletions

View File

@@ -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

View File

@@ -0,0 +1,39 @@
From 9c7aa2956eebd3f739dc9f60d041923cdb9ffa06 Mon Sep 17 00:00:00 2001
From: jj <jj@imput.net>
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 <tsepez@chromium.org>
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
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