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

The python PEG parser generator doesn't allow f-strings anymore in actions #125588

Closed
pablogsal opened this issue Oct 16, 2024 · 2 comments
Closed

Comments

@pablogsal
Copy link
Member

pablogsal commented Oct 16, 2024

After the changes in 3.12 to the f-string formalisation, the PEG parser doesn't recognise the new tokens.

Linked PRs

pablogsal added a commit to pablogsal/cpython that referenced this issue Oct 16, 2024
pablogsal added a commit to pablogsal/cpython that referenced this issue Oct 16, 2024
Eclips4 added a commit to pablogsal/cpython that referenced this issue Oct 16, 2024
@lysnikolaou lysnikolaou changed the title The python PEG parser generator doesn't allow strings anymore in actions The python PEG parser generator doesn't allow f-strings anymore in actions Oct 16, 2024
pablogsal added a commit to pablogsal/cpython that referenced this issue Oct 16, 2024
pablogsal added a commit to pablogsal/cpython that referenced this issue Oct 16, 2024
pablogsal added a commit to pablogsal/cpython that referenced this issue Oct 29, 2024
@db3l
Copy link
Contributor

db3l commented Nov 22, 2024

Just ran into this today when trying to test a clean build of main on my buildbot. My buildbot has a system python of 3.11, but with this change, it needs to be 3.12+ otherwise there's an exception on non-existent FSTRING_* attributes in the token module. The issue hasn't yet presented itself on any of the regular builder builds, I guess due to re-generation not usually being necessary, but presumably it will the next time the grammar is touched.

It appears 3.10+ is the current minimum enforced by find_python.bat under Windows (and I believe configure under Linux). I can fix things by adding a default "None" parameter to the new getattr() calls (together with the existing "if not" checks) but am unsure if this would still produce the right final output, or if the minimum system python version just needs to be bumped.

@pablogsal
Copy link
Member Author

Just ran into this today when trying to test a clean build of main on my buildbot. My buildbot has a system python of 3.11, but with this change, it needs to be 3.12+ otherwise there's an exception on non-existent FSTRING_* attributes in the token module. The issue hasn't yet presented itself on any of the regular builder builds, I guess due to re-generation not usually being necessary, but presumably it will the next time the grammar is touched.

I think that has been an oversight in #125589 I will fix it soon

pablogsal added a commit to pablogsal/cpython that referenced this issue Dec 15, 2024
pablogsal added a commit to pablogsal/cpython that referenced this issue Dec 15, 2024
pablogsal added a commit that referenced this issue Dec 15, 2024
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this issue Jan 8, 2025
ebonnal pushed a commit to ebonnal/cpython that referenced this issue Jan 12, 2025
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

3 participants