From ee3c9f4d5455c50ecb9320a7a03036b79e8c2fbfbdc3086f598f69ff7f0328c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 15 Mar 2019 12:22:00 +0000 Subject: [PATCH 1/2] - Fix build with PyYAML > 5: * yaml5.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Markdown?expand=0&rev=54 --- python-Markdown.changes | 6 ++++++ python-Markdown.spec | 5 +++-- yaml5.patch | 47 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 yaml5.patch diff --git a/python-Markdown.changes b/python-Markdown.changes index 93b48ca..b0589e3 100644 --- a/python-Markdown.changes +++ b/python-Markdown.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Mar 15 12:20:56 UTC 2019 - Tomáš Chvátal + +- Fix build with PyYAML > 5: + * yaml5.patch + ------------------------------------------------------------------- Wed Jan 2 11:04:33 UTC 2019 - badshah400@gmail.com diff --git a/python-Markdown.spec b/python-Markdown.spec index 2af747e..06d6830 100644 --- a/python-Markdown.spec +++ b/python-Markdown.spec @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -27,6 +27,7 @@ Group: Development/Languages/Python Url: https://python-markdown.github.io/ Source: https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz Patch0: markdown-3.0-python37.patch +Patch1: yaml5.patch BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module xml} @@ -53,7 +54,7 @@ supported by the [Available Extensions][]. %prep %setup -q -n Markdown-%{version} -%patch0 -p1 +%autopatch -p1 %build %python_build diff --git a/yaml5.patch b/yaml5.patch new file mode 100644 index 0000000..e4bfe6e --- /dev/null +++ b/yaml5.patch @@ -0,0 +1,47 @@ +From 0861bb0df43a20737c38029bcf7d09b14d17352f Mon Sep 17 00:00:00 2001 +From: Waylan Limberg +Date: Thu, 14 Mar 2019 09:17:31 -0400 +Subject: [PATCH] Update CLI to support PyYAML 5.1 + +This should avoid any warnings. We use `unsafe_load` because users may +need to pass in actual Python objects. As this is only available from +the CLI, the user has much worse problems if an attacker can use this +as an attach vector. +--- + docs/change_log/release-3.1.md | 1 + + markdown/__main__.py | 14 +++++++++++--- + 2 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/markdown/__main__.py b/markdown/__main__.py +index 38d08fe0..43e486c9 100644 +--- a/markdown/__main__.py ++++ b/markdown/__main__.py +@@ -26,9 +26,17 @@ + import warnings + import markdown + try: +- import yaml ++ # We use `unsafe_load` because users may need to pass in actual Python ++ # objects. As this is only available from the CLI, the user has much ++ # worse problems if an attacker can use this as an attach vector. ++ from yaml import unsafe_load as yaml_load + except ImportError: # pragma: no cover +- import json as yaml ++ try: ++ # Fall back to PyYAML <5.1 ++ from yaml import load as yaml_load ++ except ImportError: ++ # Fall back to JSON ++ from json import load as yaml_load + + import logging + from logging import DEBUG, WARNING, CRITICAL +@@ -97,7 +105,7 @@ def parse_options(args=None, values=None): + options.configfile, mode="r", encoding=options.encoding + ) as fp: + try: +- extension_configs = yaml.load(fp) ++ extension_configs = yaml_load(fp) + except Exception as e: + message = "Failed parsing extension config file: %s" % \ + options.configfile From 79bd98028fec90eb776b0756c0a94784313fea8fa01a0f8985a93a3cb249dcdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 27 Mar 2019 06:29:33 +0000 Subject: [PATCH 2/2] Accepting request 688902 from home:benoit_monin:branches:devel:languages:python - update to version 3.1 - remove yaml5.patch: merged upstream OBS-URL: https://build.opensuse.org/request/show/688902 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Markdown?expand=0&rev=55 --- Markdown-3.0.1.tar.gz | 3 --- Markdown-3.1.tar.gz | 3 +++ python-Markdown.changes | 31 +++++++++++++++++++++++++++ python-Markdown.spec | 3 +-- yaml5.patch | 47 ----------------------------------------- 5 files changed, 35 insertions(+), 52 deletions(-) delete mode 100644 Markdown-3.0.1.tar.gz create mode 100644 Markdown-3.1.tar.gz delete mode 100644 yaml5.patch diff --git a/Markdown-3.0.1.tar.gz b/Markdown-3.0.1.tar.gz deleted file mode 100644 index dad1c63..0000000 --- a/Markdown-3.0.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d02e0f9b04c500cde6637c11ad7c72671f359b87b9fe924b2383649d8841db7c -size 284084 diff --git a/Markdown-3.1.tar.gz b/Markdown-3.1.tar.gz new file mode 100644 index 0000000..479913a --- /dev/null +++ b/Markdown-3.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc4a6f69a656b8d858d7503bda633f4dd63c2d70cf80abdc6eafa64c4ae8c250 +size 293761 diff --git a/python-Markdown.changes b/python-Markdown.changes index b0589e3..f650eda 100644 --- a/python-Markdown.changes +++ b/python-Markdown.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Mar 26 19:34:04 UTC 2019 - Benoît Monin + +- update to version 3.1: + * The following new features have been included in the release: + + A Contributing Guide has been added (#732) + + A new configuration option to set the footnote separator has + been added. Also, the rel and rev attributes have been + removed from footnotes as they are not valid in HTML5. The + refs and backrefs classes already exist and serve the same + purpose (#723). + + A new option for toc_depth to set not only the bottom section + level, but also the top section level. A string consisting of + two digits separated by a hyphen in between ("2-5"), defines + the top (t) and the bottom (b) (..). A single integer + still defines the bottom section level (

..) only.(#787) + * The following bug fixes are included in the 3.1 release: + + Update CLI to support PyYAML 5.1. + + Overlapping raw HTML matches no longer leave placeholders + behind (#458). + + Emphasis patterns now recognize newline characters as + whitespace (#783). + + Version format had been updated to be PEP 440 compliant + (#736). + + Block level elements are defined per instance, not as class + attributes (#731). + + Double escaping of block code has been eliminated (#725). + + Problems with newlines in references has been fixed (#742). + + Escaped # are now handled in header syntax (#762). +- remove yaml5.patch: merged upstream + ------------------------------------------------------------------- Fri Mar 15 12:20:56 UTC 2019 - Tomáš Chvátal diff --git a/python-Markdown.spec b/python-Markdown.spec index 06d6830..55dd289 100644 --- a/python-Markdown.spec +++ b/python-Markdown.spec @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define oldpython python Name: python-Markdown -Version: 3.0.1 +Version: 3.1 Release: 0 Summary: Python implementation of Markdown License: BSD-3-Clause @@ -27,7 +27,6 @@ Group: Development/Languages/Python Url: https://python-markdown.github.io/ Source: https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz Patch0: markdown-3.0-python37.patch -Patch1: yaml5.patch BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module xml} diff --git a/yaml5.patch b/yaml5.patch deleted file mode 100644 index e4bfe6e..0000000 --- a/yaml5.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0861bb0df43a20737c38029bcf7d09b14d17352f Mon Sep 17 00:00:00 2001 -From: Waylan Limberg -Date: Thu, 14 Mar 2019 09:17:31 -0400 -Subject: [PATCH] Update CLI to support PyYAML 5.1 - -This should avoid any warnings. We use `unsafe_load` because users may -need to pass in actual Python objects. As this is only available from -the CLI, the user has much worse problems if an attacker can use this -as an attach vector. ---- - docs/change_log/release-3.1.md | 1 + - markdown/__main__.py | 14 +++++++++++--- - 2 files changed, 12 insertions(+), 3 deletions(-) - -diff --git a/markdown/__main__.py b/markdown/__main__.py -index 38d08fe0..43e486c9 100644 ---- a/markdown/__main__.py -+++ b/markdown/__main__.py -@@ -26,9 +26,17 @@ - import warnings - import markdown - try: -- import yaml -+ # We use `unsafe_load` because users may need to pass in actual Python -+ # objects. As this is only available from the CLI, the user has much -+ # worse problems if an attacker can use this as an attach vector. -+ from yaml import unsafe_load as yaml_load - except ImportError: # pragma: no cover -- import json as yaml -+ try: -+ # Fall back to PyYAML <5.1 -+ from yaml import load as yaml_load -+ except ImportError: -+ # Fall back to JSON -+ from json import load as yaml_load - - import logging - from logging import DEBUG, WARNING, CRITICAL -@@ -97,7 +105,7 @@ def parse_options(args=None, values=None): - options.configfile, mode="r", encoding=options.encoding - ) as fp: - try: -- extension_configs = yaml.load(fp) -+ extension_configs = yaml_load(fp) - except Exception as e: - message = "Failed parsing extension config file: %s" % \ - options.configfile