Skip to content
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

Regression when using OneOrMore with nestedExpr #504

Open
tobias-urdin opened this issue Jul 31, 2023 · 6 comments
Open

Regression when using OneOrMore with nestedExpr #504

tobias-urdin opened this issue Jul 31, 2023 · 6 comments

Comments

@tobias-urdin
Copy link

Hello,

We tried upgrading from 3.0.9 to 3.1.0 and noticed the following regression in that the error message changed, is this intended? Thanks!

import pyparsing

v = '(metroc foo bar'

try:
    v = pyparsing.OneOrMore(
            pyparsing.nestedExpr()).parseString(v).asList()[0]
except pyparsing.ParseException as e:
    print(str(e))
(env1) tobias.urdin@MacBook-Pro-TU reprod % pip install pyparsing==3.0.9
Collecting pyparsing==3.0.9
  Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Installing collected packages: pyparsing
Successfully installed pyparsing-3.0.9

(env1) tobias.urdin@MacBook-Pro-TU reprod % python3 test.py 
Expected ')', found end of text  (at char 15), (line:1, col:16)

(env1) tobias.urdin@MacBook-Pro-TU reprod % pip install pyparsing==3.1.0
Collecting pyparsing==3.1.0
  Using cached pyparsing-3.1.0-py3-none-any.whl (102 kB)
Installing collected packages: pyparsing
  Attempting uninstall: pyparsing
    Found existing installation: pyparsing 3.0.9
    Uninstalling pyparsing-3.0.9:
      Successfully uninstalled pyparsing-3.0.9
Successfully installed pyparsing-3.1.0

(env1) tobias.urdin@MacBook-Pro-TU reprod % python3 test.py             
Expected nested () expression, found end of text  (at char 15), (line:1, col:16)
tobias-urdin added a commit to tobias-urdin/gnocchi that referenced this issue Jul 31, 2023
The 3.1.0 release of pyparsing introduced a change
or regression in the error message that we parse
in the gabbit tests so we pin until that is investigated
in the issue [1].

[1] pyparsing/pyparsing#504
tobias-urdin added a commit to tobias-urdin/gnocchi that referenced this issue Jul 31, 2023
The 3.1.0 release of pyparsing introduced a change
or regression in the error message that we parse
in the gabbit tests so we pin until that is investigated
in the issue [1].

[1] pyparsing/pyparsing#504
tobias-urdin added a commit to tobias-urdin/gnocchi that referenced this issue Jul 31, 2023
The 3.1.0 release of pyparsing introduced a change
or regression in the error message that we parse
in the gabbit tests so we pin until that is investigated
in the issue [1].

[1] pyparsing/pyparsing#504
@ptmcg
Copy link
Member

ptmcg commented Aug 1, 2023

Thanks for submitting this issue. I made some updates in the recent 3.1.1 release around the changes in error messages, but those changes did not address this issue. I agree that the previous error message is clearer and more helpful. I'll try to get a 3.1.2 out with a fix, but it will probably not be for a few weeks.

tobias-urdin added a commit to tobias-urdin/gnocchi that referenced this issue Aug 1, 2023
The 3.1.0 release of pyparsing introduced a change
or regression in the error message that we parse
in the gabbit tests so we pin until that is investigated
in the issue [1].

[1] pyparsing/pyparsing#504
@tobias-urdin
Copy link
Author

thanks! :)

rafaelweingartner pushed a commit to rafaelweingartner/gnocchi that referenced this issue Aug 1, 2023
The 3.1.0 release of pyparsing introduced a change
or regression in the error message that we parse
in the gabbit tests so we pin until that is investigated
in the issue [1].

[1] pyparsing/pyparsing#504
@tobias-urdin
Copy link
Author

Hello @ptmcg 👋 Sorry for the bump – is there any plan to release a new 3.1.2 with a fix for this anytime soon or should we adapt to the new error message instead?

@ptmcg
Copy link
Member

ptmcg commented Oct 11, 2023

Thanks again for your patience. I will look at this by the weekend at the latest.

tobias-urdin added a commit to tobias-urdin/gnocchi that referenced this issue Oct 13, 2023
This was pinned in due to [1] error message
changing in pyparsing.

[1] pyparsing/pyparsing#504
tobias-urdin added a commit to tobias-urdin/gnocchi that referenced this issue Oct 13, 2023
Revert this commit when [1] is fixed.

[1] pyparsing/pyparsing#504
@vyzigold
Copy link

Hi, I was looking at this issue a little bit. I wanted to fix it, so that gnocchi can unpin pyparsing. I am unsure what is the correct way to change that error message, but at least I found what change caused this error message to change. Maybe it'll help with fixing the issue. Using the tobias' test code, the pyparsing falls into the except there and rewrites the old "Expected ')' ..." error message to "Expected nested () ...".

4cd691f#diff-651b49e05968bd7f42614f05b7e9d94b30f52db27eb692ce20ef87e9799c624fR4449-R4453

@ptmcg
Copy link
Member

ptmcg commented Oct 23, 2023

Thanks for the research - looking at this this evening.

tobias-urdin added a commit to tobias-urdin/gnocchi that referenced this issue Nov 3, 2023
This was pinned in due to [1] error message
changing in pyparsing.

[1] pyparsing/pyparsing#504
tobias-urdin added a commit to tobias-urdin/gnocchi that referenced this issue Nov 3, 2023
Revert this commit when [1] is fixed.

[1] pyparsing/pyparsing#504
mergify bot pushed a commit to gnocchixyz/gnocchi that referenced this issue Dec 21, 2023
This was pinned in due to [1] error message
changing in pyparsing.

[1] pyparsing/pyparsing#504

(cherry picked from commit 1d987c8)
mergify bot pushed a commit to gnocchixyz/gnocchi that referenced this issue Dec 21, 2023
Revert this commit when [1] is fixed.

[1] pyparsing/pyparsing#504

(cherry picked from commit 64fe102)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants