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

[ENH]: Parser errors should mention that commands do not exist #26732

Closed
mathstuf opened this issue Sep 11, 2023 · 2 comments
Closed

[ENH]: Parser errors should mention that commands do not exist #26732

mathstuf opened this issue Sep 11, 2023 · 2 comments
Milestone

Comments

@mathstuf
Copy link

Problem

I recently hit a parser error after upgrading matplotlib from 3.4.2 to 3.7.2 in our build:

\sum_{i=0}^\infty x_i * \frac{3}{4} \binom{3}{4} \stackrel{3}{4} * \sqrt[3]{x}
                                                 ^
ParseFatalException: Expected token, found '\'  (at char 49), (line:1, col:50)

After digging through a few rabbit holes (e.g., reverting from pyparsing 3.1.x to 3.0.9), it turns out that stackrel had been deprecated all the way back in 3.1.0.

Proposed solution

It would be nice if, instead of an error like this, it says something like 'stackrel is not a recognized command". Even better would be to have the stackrel deprecation bring up a warning/error at this point.

@ksunden
Copy link
Member

ksunden commented Sep 11, 2023

This is a result of a change to pyparsing that I'm pretty sure we have largely fixed, though it did incur changes in both mpl and pyparsing.

The happy path always worked, just there are some combinations that get less helpful error messages like this.

On main I get:

ParseFatalException: Unknown symbol: \stackrel, found '\'  (at char 49), (line:1, col:50)

xref:

This will be fixed with 3.7.3 (when released), though also requires pyparsing !=3.1.0 for the error message. We decided not to enforce that restriction for install since working code continued to work, but did add some xfails to our test suite with the affected combinations.

Since this is fixed on main/the release branch, I will close this

@mathstuf
Copy link
Author

Thanks for the info. Can this get a 3.7.3 milestone too so that it gets tracked for others searching?

@ksunden ksunden added this to the v3.7.3 milestone Sep 11, 2023
@ksunden ksunden closed this as completed Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants