From e41dbb29bac29b54a8534c2b8ecdf1411dbc78b2 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Wed, 22 Jan 2020 07:28:18 -0500 Subject: [PATCH] import python-reportlab-3.4.0-6.el8_1.2 --- .../python-reportlab-3.4.0-color-eval.patch | 60 +++++++++++++++++++ SPECS/python-reportlab.spec | 16 ++++- 2 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 SOURCES/python-reportlab-3.4.0-color-eval.patch diff --git a/SOURCES/python-reportlab-3.4.0-color-eval.patch b/SOURCES/python-reportlab-3.4.0-color-eval.patch new file mode 100644 index 0000000..5518c76 --- /dev/null +++ b/SOURCES/python-reportlab-3.4.0-color-eval.patch @@ -0,0 +1,60 @@ +--- python3-python-reportlab-3.4.0-6.el8/src/reportlab/lib/colors.py ++++ python3-python-reportlab-3.4.0-6.el8/src/reportlab/lib/colors.py +@@ -835,6 +835,44 @@ class cssParse: + + cssParse=cssParse() + ++def parseColorClassFromString(arg): ++ splitted = "".join(arg.split()).replace('(', ',').replace(')','').split(',') ++ fingerprint = ''.join(c for c in arg if c in set('(,)')) ++ if (len(splitted) > 0): ++ if (splitted[0] == 'Color'): ++ if (fingerprint == '(,,,)'): ++ try: ++ return Color(*list(map(float, splitted[1:5]))) ++ except: ++ return None ++ elif (fingerprint == '(,,)'): ++ try: ++ return Color(*list(map(float, splitted[1:4]))) ++ except: ++ return None ++ elif (splitted[0] == 'CMYKColor' and fingerprint == '(,,,)'): ++ try: ++ return CMYKColor(*list(map(float, splitted[1:5]))) ++ except: ++ return None ++ elif (splitted[0] == 'PCMYKColor' and fingerprint == '(,,,)'): ++ try: ++ return PCMYKColor(*list(map(float, splitted[1:5]))) ++ except: ++ return None ++ elif (splitted[0] == 'CMYKColorSep' and fingerprint == '(,,,)'): ++ try: ++ return CMYKColorSep(*list(map(float, splitted[1:5]))) ++ except: ++ return None ++ elif (splitted[0] == 'PCMYKColorSep' and fingerprint == '(,,,)'): ++ try: ++ return PCMYKColorSep(*list(map(float, splitted[1:5]))) ++ except: ++ return None ++ else: ++ return None ++ + class toColor: + + def __init__(self): +@@ -860,10 +898,8 @@ class toColor: + C = getAllNamedColors() + s = arg.lower() + if s in C: return C[s] +- try: +- return toColor(eval(arg)) +- except: +- pass ++ parsedColor = parseColorClassFromString(arg) ++ if (parsedColor): return parsedColor + + try: + return HexColor(arg) diff --git a/SPECS/python-reportlab.spec b/SPECS/python-reportlab.spec index dd8a0c4..356aed3 100644 --- a/SPECS/python-reportlab.spec +++ b/SPECS/python-reportlab.spec @@ -3,12 +3,15 @@ Name: python-%{pypi} Version: 3.4.0 -Release: 6%{?dist} +Release: 6%{?dist}.2 Summary: Library for generating PDFs and graphics License: BSD URL: http://www.reportlab.org/ Source0: https://pypi.python.org/packages/source/r/%{pypi}/%{pypi}-%{version}.tar.gz +# https://bugzilla.redhat.com/show_bug.cgi?id=1769661 +Patch0: python-reportlab-3.4.0-color-eval.patch + %package -n python3-%{pypi} Summary: Library for generating PDFs and graphics BuildRequires: python3-devel @@ -31,7 +34,7 @@ formats. %package doc Summary: Documentation for %{name} BuildArch: noarch -Requires: %{name} = %{version}-%{release} +Requires: python3-%{pypi} = %{version}-%{release} Obsoletes: %{name}-docs < %{version}-%{release} %description doc @@ -39,6 +42,7 @@ Contains the documentation for ReportLab. %prep %setup -qn reportlab-%{version} +%patch0 -p1 -b .color-eval # clean up hashbangs from libraries find src -name '*.py' | xargs sed -i -e '/^#!\//d' # patch the CMap path by adding Fedora ghostscript path before the match @@ -74,6 +78,14 @@ rm -rf %{buildroot}%{python3_sitearch}/reportlab/fonts #%doc docs/*.pdf %changelog +* Wed Jan 15 2020 Marek Kasik - 3.4.0-6.el8_1_0.2 +- Fix Requires for doc subpackage +- Resolves: #1788556 + +* Tue Jan 14 2020 Marek Kasik - 3.4.0-6.el8_1_0.1 +- Do not eval strings passed to toColor +- Resolves: #1788555 + * Thu May 31 2018 Marek Kasik - 3.4.0-6 - Remove python2-reportlab subpackage - Resolves: #1567162