Hello community, here is the log from the commit of package python-scales for openSUSE:Leap:15.2 checked in at 2020-03-02 13:22:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/python-scales (Old) and /work/SRC/openSUSE:Leap:15.2/.python-scales.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-scales" Mon Mar 2 13:22:27 2020 rev:3 rq:777115 version:1.0.9 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/python-scales/python-scales.changes 2020-01-15 15:52:48.919576305 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.python-scales.new.26092/python-scales.changes 2020-03-02 13:22:28.774293645 +0100 @@ -1,0 +2,6 @@ +Tue Sep 10 13:59:35 UTC 2019 - Tomáš Chvátal <[email protected]> + +- Add patch to work with python 3.8: + * python38.patch + +------------------------------------------------------------------- New: ---- python38.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-scales.spec ++++++ --- /var/tmp/diff_new_pack.2VEh6M/_old 2020-03-02 13:22:29.230294552 +0100 +++ /var/tmp/diff_new_pack.2VEh6M/_new 2020-03-02 13:22:29.230294552 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-scales # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,7 @@ URL: https://www.github.com/Cue/scales Source: https://files.pythonhosted.org/packages/source/s/scales/scales-%{version}.tar.gz Source99: https://raw.githubusercontent.com/Cue/scales/master/LICENSE +Patch0: python38.patch BuildRequires: %{python_module nose} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} @@ -40,6 +41,7 @@ %prep %setup -q -n scales-%{version} +%patch0 -p1 cp %{SOURCE99} . %build ++++++ python38.patch ++++++ >From ee69d45f1a7f928f7b241702e9be06007444115e Mon Sep 17 00:00:00 2001 From: Lumir Balhar <[email protected]> Date: Fri, 30 Aug 2019 10:59:43 +0200 Subject: [PATCH 2/2] Use `html` module in Python 3 and cgi module in Python 2 `cgi.escape()` has been deprecated since Python 3.2 and removed from Python 3.8. Fixes: https://github.com/Cue/scales/issues/46 --- src/greplin/scales/formats.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/greplin/scales/formats.py b/src/greplin/scales/formats.py index c4ef979..b6a96d4 100644 --- a/src/greplin/scales/formats.py +++ b/src/greplin/scales/formats.py @@ -16,7 +16,11 @@ from greplin import scales -import cgi +try: + import html +except ImportError: + # Python 2.7 has no html module + import cgi as html import six import json import operator @@ -105,7 +109,7 @@ def _htmlRenderDict(pathParts, statDict, output): output.write('<div class="level">') for key in keys: - keyStr = cgi.escape(_utf8str(key)) + keyStr = html.escape(_utf8str(key)) value = statDict[key] if hasattr(value, '__call__'): value = value() @@ -119,7 +123,7 @@ def _htmlRenderDict(pathParts, statDict, output): _htmlRenderDict(valuePath, value, output) else: output.write('<div><span class="key">%s</span> <span class="%s">%s</span></div>' % - (keyStr, type(value).__name__, cgi.escape(_utf8str(value)).replace('\n', '<br/>'))) + (keyStr, type(value).__name__, html.escape(_utf8str(value)).replace('\n', '<br/>'))) if links: for link in links:
