-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support pyparsing v3 (AttributeError downcaseTokens) #207
Comments
This is a breaking issue – the requirements.txt file should be updated to:
|
@mborsetti please starting from clean virtualenv, show @seanlinehan current requirements already excludes all 3.x. |
Anyone here have a winning combo of UPDATE: I pinned to |
So, I work on a project that was also depends |
solution
causeOld pip dependency resolver allowed installation of conflicting requirements. Installing httplib2 (with requirements pyparsing<3) would not downgrade existing pyparsing>=3.
So upgrade pip might also help.
|
For the long run, could replacing |
The current version of pyparsing doesn't support
|
how can I push that fix? |
Irrelevant because in my virtualenv
Also irrelevant, because it turns out that
Thanks @Fahadsaadullahkhan: supporting the current version of the library is the only way to permanently resolve conflicts, as well as ensuring that any eventual security bug present in an obsolete version of a library is not carried into this one. |
It fixes import, but parser doesn't work. Please try following: git clone https://github.com/httplib2/httplib2 tmp207
cd tmp207
git apply <<END
diff --git a/python3/httplib2/auth.py b/python3/httplib2/auth.py
index 84b5831..9fe69f2 100644
--- a/python3/httplib2/auth.py
+++ b/python3/httplib2/auth.py
@@ -5,6 +5,11 @@ import pyparsing as pp
from .error import *
+try:
+ downcaseTokens = pp.common.downcaseTokens
+except AttributeError:
+ downcaseTokens = pp.downcaseTokens
+
UNQUOTE_PAIRS = re.compile(r"\\(.)")
unquote = lambda s, l, t: UNQUOTE_PAIRS.sub(r"\1", t[0][1:-1])
@@ -17,7 +22,7 @@ token68 = pp.Combine(pp.Word("-._~+/" + pp.nums + pp.alphas) + pp.Optional(pp.Wo
)
quoted_string = pp.dblQuotedString.copy().setName("quoted-string").setParseAction(unquote)
-auth_param_name = token.copy().setName("auth-param-name").addParseAction(pp.downcaseTokens)
+auth_param_name = token.copy().setName("auth-param-name").addParseAction(downcaseTokens)
auth_param = auth_param_name + pp.Suppress("=") + (quoted_string | token)
params = pp.Dict(pp.delimitedList(pp.Group(auth_param)))
END
python3 -m venv venv
venv/bin/pip install -e . -r requirements-test.txt
venv/bin/pip install 'pyparsing>=3'
venv/bin/pytest -sv tests/test_auth.py |
because of this httplib2/httplib2#207
@temoto Thanks; this seems to work. |
It definitely doesn't work. Subscribe to recent pyparsing issue.
…On Sat, Oct 30, 2021, 12:13 Mike Borsetti ***@***.***> wrote:
For the long run, could replacing pp.downcaseTokens with
pp.pyparsing_common.downcase_tokens be a possible solution? That fixed it
in my fresh virtualenv, it seems a bit too easy though, so I might be
missing something.
It fixes import, but parser doesn't work.
Please try following:
git clone https://github.com/httplib2/httplib2 tmp207cd tmp207
git apply <<ENDdiff --git a/python3/httplib2/auth.py b/python3/httplib2/auth.pyindex 84b5831..9fe69f2 100644--- a/python3/httplib2/auth.py+++ b/python3/httplib2/auth.py@@ -5,6 +5,11 @@ import pyparsing as pp from .error import *+try:+ downcaseTokens = pp.common.downcaseTokens+except AttributeError:+ downcaseTokens = pp.downcaseTokens+ UNQUOTE_PAIRS = re.compile(r"\\(.)") unquote = lambda s, l, t: UNQUOTE_PAIRS.sub(r"\1", t[0][1:-1])@@ -17,7 +22,7 @@ token68 = pp.Combine(pp.Word("-._~+/" + pp.nums + pp.alphas) + pp.Optional(pp.Wo ) quoted_string = pp.dblQuotedString.copy().setName("quoted-string").setParseAction(unquote)-auth_param_name = token.copy().setName("auth-param-name").addParseAction(pp.downcaseTokens)+auth_param_name = token.copy().setName("auth-param-name").addParseAction(downcaseTokens) auth_param = auth_param_name + pp.Suppress("=") + (quoted_string | token) params = pp.Dict(pp.delimitedList(pp.Group(auth_param)))END
python3 -m venv venv
venv/bin/pip install -e . -r requirements-test.txt
venv/bin/pip install 'pyparsing>=3'
venv/bin/pytest -sv tests/test_auth.py
@temoto <https://github.com/temoto> Thanks; this seems to work.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#207 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAGTMJDONSRBFHQKT74U53UJOZM3ANCNFSM5GVGUVCA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Fixed in |
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
There appears to be a use of a discontinued feature from the
pyparsing
library:The text was updated successfully, but these errors were encountered: