diff --git a/fonttools.spec b/fonttools.spec index 4c99eb635070e686644866751caec3f57ae53450..2857b4abc105edda1565041b23884fe65a6208a2 100644 --- a/fonttools.spec +++ b/fonttools.spec @@ -1,10 +1,11 @@ Name: fonttools Version: 3.29.0 -Release: 3 +Release: 4 Summary: Tools to manipulate font files License: MIT URL: https://github.com/fonttools/fonttools/ Source0: %{url}/releases/download/%{version}/fonttools-%{version}.zip +Patch01: replace-fromtring-with-frombytes.patch Requires: python3-fonttools BuildArch: noarch Provides: ttx = %{version}-%{release} @@ -62,6 +63,9 @@ rm -rf *.egg-info %{python3_sitelib}/fonttools-%{version}-py3.?.egg-info %changelog +* Fri Jan 07 2022 houyingchao - 3.29.0-4 +- Replace fromtring with frombytes + * Thu Oct 22 2020 huanghaitao - 3.29.0-3 - Disable python2 module diff --git a/replace-fromtring-with-frombytes.patch b/replace-fromtring-with-frombytes.patch new file mode 100644 index 0000000000000000000000000000000000000000..d0653abc5ca868a0d006d4d16fbb4dfdcd68d905 --- /dev/null +++ b/replace-fromtring-with-frombytes.patch @@ -0,0 +1,331 @@ +From 12814aa7b174428ef7c2baf83411b12fef921e0b Mon Sep 17 00:00:00 2001 +From: Chris Simpkins +Date: Thu, 29 Aug 2019 22:58:42 -0400 +Subject: [PATCH] refactor array.fromstring to array.frombytes + +fromstring is a deprecated array method +--- + Lib/fontTools/designspaceLib/__init__.py | 2 +- + Lib/fontTools/svgLib/path/__init__.py | 8 ++++---- + Lib/fontTools/ttLib/tables/G_P_K_G_.py | 4 ++-- + Lib/fontTools/ttLib/tables/G__l_o_c.py | 4 ++-- + Lib/fontTools/ttLib/tables/L_T_S_H_.py | 2 +- + Lib/fontTools/ttLib/tables/T_S_I__5.py | 2 +- + Lib/fontTools/ttLib/tables/TupleVariation.py | 4 ++-- + Lib/fontTools/ttLib/tables/_c_m_a_p.py | 10 +++++----- + Lib/fontTools/ttLib/tables/_c_v_t.py | 2 +- + Lib/fontTools/ttLib/tables/_g_l_y_f.py | 2 +- + Lib/fontTools/ttLib/tables/_g_v_a_r.py | 2 +- + Lib/fontTools/ttLib/tables/_l_o_c_a.py | 2 +- + Lib/fontTools/ttLib/tables/_p_o_s_t.py | 4 ++-- + Lib/fontTools/varLib/designspace.py | 2 +- + Snippets/svg2glif.py | 2 +- + Tests/svgLib/path/path_test.py | 6 +++--- + 16 files changed, 29 insertions(+), 29 deletions(-) + +diff --git a/Lib/fontTools/designspaceLib/__init__.py b/Lib/fontTools/designspaceLib/__init__.py +index 8063ac5..72a4cee 100644 +--- a/Lib/fontTools/designspaceLib/__init__.py ++++ b/Lib/fontTools/designspaceLib/__init__.py +@@ -38,7 +38,7 @@ def to_plist(value): + except AttributeError: + # Python 3 + string = plistlib.dumps(value).decode() +- return ET.fromstring(string)[0] ++ return ET.frombytes(string)[0] + + + def from_plist(element): +diff --git a/Lib/fontTools/svgLib/path/__init__.py b/Lib/fontTools/svgLib/path/__init__.py +index 4f17e76..a18abd9 100644 +--- a/Lib/fontTools/svgLib/path/__init__.py ++++ b/Lib/fontTools/svgLib/path/__init__.py +@@ -27,10 +27,10 @@ class SVGPath(object): + svg.draw(pen) + + Or reading from a string containing SVG data, using the alternative +- 'fromstring' (a class method): ++ 'frombytes' (a class method): + + data = '