Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/cmark/, app-text/cmark/files/
Date: Tue, 09 Feb 2021 08:28:04
Message-Id: 1612858973.9542d8c5f26718711018b040bed295278cb15016.sam@gentoo
1 commit: 9542d8c5f26718711018b040bed295278cb15016
2 Author: Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
3 AuthorDate: Sun Feb 7 23:13:38 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 9 08:22:53 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9542d8c5
7
8 app-text/cmark: fix tests (#767850)
9
10 Fix tests runs with Python 3.8.
11 Closes: https://bugs.gentoo.org/767850
12 Package-Manager: Portage-3.0.13, Repoman-3.0.2
13 Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
14 Closes: https://github.com/gentoo/gentoo/pull/19370
15 Signed-off-by: Sam James <sam <AT> gentoo.org>
16
17 app-text/cmark/cmark-0.29.0.ebuild | 6 ++++-
18 .../cmark/files/cmark-0.29.0-python38_tests.patch | 31 ++++++++++++++++++++++
19 2 files changed, 36 insertions(+), 1 deletion(-)
20
21 diff --git a/app-text/cmark/cmark-0.29.0.ebuild b/app-text/cmark/cmark-0.29.0.ebuild
22 index 36fc6e99005..a1db9210003 100644
23 --- a/app-text/cmark/cmark-0.29.0.ebuild
24 +++ b/app-text/cmark/cmark-0.29.0.ebuild
25 @@ -1,4 +1,4 @@
26 -# Copyright 1999-2020 Gentoo Authors
27 +# Copyright 1999-2021 Gentoo Authors
28 # Distributed under the terms of the GNU General Public License v2
29
30 EAPI=7
31 @@ -19,6 +19,10 @@ RESTRICT="!test? ( test )"
32
33 DEPEND="test? ( ${PYTHON_DEPS} )"
34
35 +PATCHES=(
36 + "${FILESDIR}/${P}-python38_tests.patch"
37 +)
38 +
39 pkg_setup() {
40 use test && python-any-r1_pkg_setup
41 }
42
43 diff --git a/app-text/cmark/files/cmark-0.29.0-python38_tests.patch b/app-text/cmark/files/cmark-0.29.0-python38_tests.patch
44 new file mode 100644
45 index 00000000000..13cd7181594
46 --- /dev/null
47 +++ b/app-text/cmark/files/cmark-0.29.0-python38_tests.patch
48 @@ -0,0 +1,31 @@
49 +From 92697d564042d5b914048e087e4274c3c71e0055 Mon Sep 17 00:00:00 2001
50 +From: Christopher Fujino <christopherfujino@×××××.com>
51 +Date: Sun, 12 Jul 2020 16:11:42 -0700
52 +Subject: [PATCH] replace cgi.escape with html.escape (#656)
53 +
54 +---
55 + test/normalize.py | 4 ++--
56 + 1 file changed, 2 insertions(+), 2 deletions(-)
57 +
58 +diff --git a/test/normalize.py b/test/normalize.py
59 +index 6073bf01..f8ece18d 100644
60 +--- a/test/normalize.py
61 ++++ b/test/normalize.py
62 +@@ -13,7 +13,7 @@ class HTMLParseError(Exception):
63 + from html.entities import name2codepoint
64 + import sys
65 + import re
66 +-import cgi
67 ++import html
68 +
69 + # Normalization code, adapted from
70 + # https://github.com/karlcow/markdown-testsuite/
71 +@@ -66,7 +66,7 @@ def handle_starttag(self, tag, attrs):
72 + self.output += ("=" + '"' +
73 + urllib.quote(urllib.unquote(v), safe='/') + '"')
74 + elif v != None:
75 +- self.output += ("=" + '"' + cgi.escape(v,quote=True) + '"')
76 ++ self.output += ("=" + '"' + html.escape(v,quote=True) + '"')
77 + self.output += ">"
78 + self.last_tag = tag
79 + self.last = "starttag"