summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2022-01-06 09:07:42 +0100
committerFabian Groffen <grobian@gentoo.org>2022-01-06 09:07:42 +0100
commita71dd49cbd39fe665d469ff392d31816436610a1 (patch)
tree6f78608cbc9215759284d9c33757b8674706cbad /net-analyzer/graphite-web/files
parentsys-kernel/pf-sources: add 5.15-pf6 (diff)
downloadgentoo-a71dd49cbd39fe665d469ff392d31816436610a1.tar.gz
gentoo-a71dd49cbd39fe665d469ff392d31816436610a1.tar.bz2
gentoo-a71dd49cbd39fe665d469ff392d31816436610a1.zip
net-analyzer/graphite-web-1.1.8: version bump, fix pyparsing interaction
Closes: https://bugs.gentoo.org/829727 Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'net-analyzer/graphite-web/files')
-rw-r--r--net-analyzer/graphite-web/files/graphite-web-1.1.8-pyparsing3.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/net-analyzer/graphite-web/files/graphite-web-1.1.8-pyparsing3.patch b/net-analyzer/graphite-web/files/graphite-web-1.1.8-pyparsing3.patch
new file mode 100644
index 000000000000..6a1c44ff0109
--- /dev/null
+++ b/net-analyzer/graphite-web/files/graphite-web-1.1.8-pyparsing3.patch
@@ -0,0 +1,60 @@
+Modified to apply on 1.1.8 release
+
+From 5de8405307ded14930b3381380e9f91e583172a9 Mon Sep 17 00:00:00 2001
+From: parrotpock <51694161+parrotpock@users.noreply.github.com>
+Date: Mon, 15 Nov 2021 17:39:23 +0100
+Subject: [PATCH] Fix pyparsing > 3.0 compatibility issue. (#2727)
+
+* Fix bool() issue in recursion termination check.
+
+The behaviour of ParsedResults seems to have changed in the way that
+the usage of pop() along with the bool() check on the object interact
+wrt checking if there are further elements in the parsed structure to
+consume. In version > 3.0 bool() checks whether either the internal
+_toklist or _tokdict members contain items left to consume and returns
+True if either do, whereas pop with no arguments will only consume from
+the underlying list. That means that we would get a True in the if
+condition in this code, whereas a subsequent call to pop() would throw
+an exception. Calling asList() forces the use of the list representation
+in the bool check here and so fixes this issue.
+
+* Fix pyparsing backwards compatibility issue.
+
+* Remove upper-bound on pin.
+
+* Add pyparsing3 test target for versions >= 3.0.6
+
+* Remove try/except, use dictionary key index syntax
+
+Co-authored-by: Ubuntu <ubuntu@ip-172-31-7-19.eu-west-1.compute.internal>
+---
+ webapp/graphite/render/evaluator.py | 2 +-
+ webapp/graphite/render/grammar_unsafe.py | 2 +-
+ 4 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/webapp/graphite/render/evaluator.py b/webapp/graphite/render/evaluator.py
+index 748626ed0c..12179dcc44 100644
+--- a/webapp/graphite/render/evaluator.py
++++ b/webapp/graphite/render/evaluator.py
+@@ -58,7 +58,7 @@ def evaluateTokens(requestContext, tokens, replacements=None, pipedArg=None):
+ return evaluateTokens(requestContext, tokens.template, arglist)
+
+ if tokens.expression:
+- if tokens.expression.pipedCalls:
++ if tokens.expression.pipedCalls.asList():
+ # when the expression has piped calls, we pop the right-most call and pass the remaining
+ # expression into it via pipedArg, to get the same result as a nested call
+ rightMost = tokens.expression.pipedCalls.pop()
+diff --git a/webapp/graphite/render/grammar_unsafe.py b/webapp/graphite/render/grammar_unsafe.py
+index f25b5eff8f..2481176b53 100644
+--- a/webapp/graphite/render/grammar_unsafe.py
++++ b/webapp/graphite/render/grammar_unsafe.py
+@@ -80,7 +80,7 @@
+
+
+ def setRaw(s, loc, toks):
+- toks[0].raw = s[toks[0].start:toks[0].end]
++ toks[0]['raw'] = s[toks[0].start:toks[0].end]
+
+
+ call = Group(