From 7de558c0a932c8864ddde3bb44ece158383401ec Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 30 Jun 2022 15:45:07 -0400 Subject: [PATCH] remove U mode from tools/grit to support modern Python3 --- ...060.53-python3-do-not-use-deprecated-mode-U.patch | 12 ++++++++++++ chromium.spec | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch diff --git a/chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch b/chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch new file mode 100644 index 00000000..e24f9d89 --- /dev/null +++ b/chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch @@ -0,0 +1,12 @@ +diff -up chromium-103.0.5060.53/tools/grit/grit/util.py.fix-python3 chromium-103.0.5060.53/tools/grit/grit/util.py +--- chromium-103.0.5060.53/tools/grit/grit/util.py.fix-python3 2022-06-30 19:38:05.483590098 +0000 ++++ chromium-103.0.5060.53/tools/grit/grit/util.py 2022-06-30 19:38:14.024304827 +0000 +@@ -209,7 +209,7 @@ def ReadFile(filename, encoding): + mode = 'rb' + encoding = None + else: +- mode = 'rU' ++ mode = 'r' + + with io.open(filename, mode, encoding=encoding) as f: + return f.read() diff --git a/chromium.spec b/chromium.spec index c30e3103..28a3bf53 100644 --- a/chromium.spec +++ b/chromium.spec @@ -299,6 +299,9 @@ Patch64: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch # https://bugs.chromium.org/p/chromium/issues/detail?id=1192875 Patch65: chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch +# Python3.9 or later no longer support the 'U' mode +Patch66: chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch + # Fix missing cstring in remoting code Patch67: chromium-98.0.4758.80-remoting-cstring.patch # Apply fix_textrels hack for i686 (even without lld) @@ -1021,6 +1024,7 @@ udev. %patch63 -p1 -b .gcc-cfi-fix %patch64 -p1 -b .aarch64-cxxflags-addition %patch65 -p1 -b .java-only-allowed +%patch66 -p1 -b .python3-do-not-use-deprecated-mode-U %patch67 -p1 -b .remoting-cstring %patch68 -p1 -b .i686-textrels %patch79 -p1 -b .widevine-no-download