From 88d52626b0bb63fc5ea20f585aa2b67bf5efe2a0 Mon Sep 17 00:00:00 2001
From: Crozzers
Date: Tue, 19 Jul 2022 22:42:54 +0100
Subject: [PATCH 01/58] Use subprocess instead of `os.system` in testall.py
---
test/testall.py | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/test/testall.py b/test/testall.py
index e26856ed..795e798a 100644
--- a/test/testall.py
+++ b/test/testall.py
@@ -2,14 +2,11 @@
#
# Run the test suite against all the Python versions we can find.
#
-
-
-
-import sys
import os
-from os.path import dirname, abspath, join
import re
-
+import subprocess
+import sys
+from os.path import abspath, dirname, join
TOP = dirname(dirname(abspath(__file__)))
sys.path.insert(0, join(TOP, "tools"))
@@ -50,7 +47,11 @@ def testall():
ver_str = "%s.%s" % ver
print("-- test with Python %s (%s)" % (ver_str, python))
assert ' ' not in python
- rv = os.system("MACOSX_DEPLOYMENT_TARGET= %s test.py -- -knownfailure" % python)
+ proc = subprocess.Popen(
+ "MACOSX_DEPLOYMENT_TARGET= %s test.py -- -knownfailure" % python,
+ shell=True
+ )
+ rv = proc.wait()
if rv:
sys.exit(os.WEXITSTATUS(rv))
From faee13e54c41a111a69e9d2a61f9076454c8b766 Mon Sep 17 00:00:00 2001
From: Crozzers
Date: Tue, 19 Jul 2022 23:08:48 +0100
Subject: [PATCH 02/58] Re-print test warnings after tests have ran (issue
#458).
This works by capturing stderr from tests and checking to see if each line contains the string "WARNING:test:".
If a line contains this string it is saved for later and re-printed once all tests have been run.
---
test/testall.py | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/test/testall.py b/test/testall.py
index 795e798a..92efd1de 100644
--- a/test/testall.py
+++ b/test/testall.py
@@ -40,6 +40,7 @@ def _gen_pythons():
yield ver, python
def testall():
+ all_warnings = []
for ver, python in _gen_pythons():
if ver < (3, 5):
# Don't support Python < 3.5
@@ -47,12 +48,26 @@ def testall():
ver_str = "%s.%s" % ver
print("-- test with Python %s (%s)" % (ver_str, python))
assert ' ' not in python
+
proc = subprocess.Popen(
- "MACOSX_DEPLOYMENT_TARGET= %s test.py -- -knownfailure" % python,
- shell=True
+ # pass "-u" option to force unbuffered output
+ "MACOSX_DEPLOYMENT_TARGET= %s -u test.py -- -knownfailure" % python,
+ shell=True, stderr=subprocess.PIPE
)
- rv = proc.wait()
- if rv:
- sys.exit(os.WEXITSTATUS(rv))
+
+ while proc.poll() is None:
+ # capture and re-print stderr while process is running
+ line = proc.stderr.readline().decode().strip()
+ print(line, file=sys.stderr)
+ if 'WARNING:test:' in line:
+ # if stderr contains a warning, save this for later
+ all_warnings.append((python, ver_str, line))
+
+ if proc.returncode:
+ sys.exit(os.WEXITSTATUS(proc.returncode))
+
+ for python, ver_str, warning in all_warnings:
+ # now re-print all warnings to make sure they are seen
+ print('-- warning raised by Python %s (%s) -- %s' % (ver_str, python, warning))
testall()
From b1e37a1675a3c7a5e1e3d8f6f6ef3feadfed418d Mon Sep 17 00:00:00 2001
From: Nicholas Serra
Date: Sun, 22 Jan 2023 16:36:24 -0500
Subject: [PATCH 03/58] prepare for 2.4.7 release
---
CHANGES.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CHANGES.md b/CHANGES.md
index abf8ed80..bf598ecb 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,6 +1,6 @@
# python-markdown2 Changelog
-## python-markdown2 2.4.7 (not yet released)
+## python-markdown2 2.4.7
- [pull #483] Fix hashing nested HTML blocks
- [pull #486] Fix backslash being unable to escape raw HTML tags
From 07edaf45111b79a3576b7522edd1204f7db3357f Mon Sep 17 00:00:00 2001
From: Nicholas Serra
Date: Sun, 22 Jan 2023 16:36:33 -0500
Subject: [PATCH 04/58] prep for future dev
---
CHANGES.md | 5 +++++
lib/markdown2.py | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/CHANGES.md b/CHANGES.md
index bf598ecb..78e8a0f9 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,5 +1,10 @@
# python-markdown2 Changelog
+## python-markdown2 2.4.8 (not yet released)
+
+(nothing yet)
+
+
## python-markdown2 2.4.7
- [pull #483] Fix hashing nested HTML blocks
diff --git a/lib/markdown2.py b/lib/markdown2.py
index 112fa707..6eeff77d 100755
--- a/lib/markdown2.py
+++ b/lib/markdown2.py
@@ -99,7 +99,7 @@
# not yet sure if there implications with this. Compare 'pydoc sre'
# and 'perldoc perlre'.
-__version_info__ = (2, 4, 7)
+__version_info__ = (2, 4, 8)
__version__ = '.'.join(map(str, __version_info__))
__author__ = "Trent Mick"
From 1e9880b5a37199867e87f7d2cd94303f43dc359f Mon Sep 17 00:00:00 2001
From: Crozzers
Date: Fri, 27 Jan 2023 22:20:32 +0000
Subject: [PATCH 05/58] Update test cases for pygments 2.14
---
test/tm-cases/fenced_code_blocks_safe_highlight.html | 4 ++--
test/tm-cases/fenced_code_blocks_syntax_highlighting.html | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/tm-cases/fenced_code_blocks_safe_highlight.html b/test/tm-cases/fenced_code_blocks_safe_highlight.html
index 105bd8c9..b77f50b1 100644
--- a/test/tm-cases/fenced_code_blocks_safe_highlight.html
+++ b/test/tm-cases/fenced_code_blocks_safe_highlight.html
@@ -9,8 +9,8 @@
http://github.github.com/github-flavored-markdown/.
-
def foo
- puts "hi"
+def foo
+ puts "hi"
end
diff --git a/test/tm-cases/fenced_code_blocks_syntax_highlighting.html b/test/tm-cases/fenced_code_blocks_syntax_highlighting.html
index 105bd8c9..b77f50b1 100644
--- a/test/tm-cases/fenced_code_blocks_syntax_highlighting.html
+++ b/test/tm-cases/fenced_code_blocks_syntax_highlighting.html
@@ -9,8 +9,8 @@