diff --git a/pyparsing-0001-Avoid-assigning-an-empty-error-message-to-delegated-.patch b/pyparsing-0001-Avoid-assigning-an-empty-error-message-to-delegated-.patch new file mode 100644 index 0000000000000000000000000000000000000000..71e080ed18734e3adb440120ef3536ec5c4002d3 --- /dev/null +++ b/pyparsing-0001-Avoid-assigning-an-empty-error-message-to-delegated-.patch @@ -0,0 +1,20 @@ +From: InSync <122007197+InSyncWithFoo@users.noreply.github.com> +Date: Sat, 13 Jan 2024 05:04:57 +0000 +Subject: [PATCH] Avoid assigning an empty error message to delegated parse + exception + + +diff --git a/pyparsing/core.py b/pyparsing/core.py +index 73514ed..fc19d1c 100644 +--- a/pyparsing/core.py ++++ b/pyparsing/core.py +@@ -4569,7 +4569,8 @@ class ParseElementEnhance(ParserElement): + return self.expr._parse(instring, loc, doActions, callPreParse=False) + except ParseBaseException as pbe: + if not isinstance(self, Forward) or self.customName is not None: +- pbe.msg = self.errmsg ++ if self.errmsg: ++ pbe.msg = self.errmsg + raise + else: + raise ParseException(instring, loc, "No expression defined", self) diff --git a/pyparsing-3.1.1.tar.gz b/pyparsing-3.1.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..64089a1650ea3b675330b2f1d8d0d8abd43856fb Binary files /dev/null and b/pyparsing-3.1.1.tar.gz differ diff --git a/pyparsing.spec b/pyparsing.spec index 421a5fad5aa8829d31ba711abc8aaeb32d93b2a4..9ff392dba90ebb27233587ecfe663f3be1822e95 100644 --- a/pyparsing.spec +++ b/pyparsing.spec @@ -1,4 +1,4 @@ -%define anolis_release 2 +%define anolis_release 1 %global build_wheel 1 %global python_wheelname pyparsing-%{version}-py3-none-any.whl @@ -8,13 +8,14 @@ %bcond_with runtests Name: pyparsing -Version: 3.0.7 +Version: 3.1.1 Release: %{anolis_release}%{?dist} Summary: Python library for creating PEG parsers License: MIT URL: https://github.com/pyparsing/pyparsing -Source0: https://github.com/pyparsing/pyparsing/archive/refs/tags/%{name}_%{version}.tar.gz +Source0: https://github.com/pyparsing/pyparsing/archive/3.1.1/pyparsing-3.1.1.tar.gz +Patch1: pyparsing-0001-Avoid-assigning-an-empty-error-message-to-delegated-.patch BuildArch: noarch @@ -26,6 +27,8 @@ BuildRequires: python3-setuptools BuildRequires: python3-sphinx BuildRequires: python3-pip BuildRequires: python3-wheel +BuildRequires: python3-pytest +BuildRequires: python3-rpm-generators %endif @@ -94,6 +97,10 @@ python3 -m unittest discover tests %changelog +* Thu Aug 28 2025 wenyuzifang - 3.1.1-1 +- Updated to version 3.1.1 to fix xxxxxxxxxx +- Preserve meaningful error messages, avoid losing context during parse exceptions. + * Wed Mar 13 2024 Zhao Hang - 3.0.7-2 - Rebuild with python3.11 diff --git a/pyparsing_3.0.7.tar.gz b/pyparsing_3.0.7.tar.gz deleted file mode 100644 index 416bac748071d73a530495635871f6356b2b33ac..0000000000000000000000000000000000000000 Binary files a/pyparsing_3.0.7.tar.gz and /dev/null differ