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

Cannot handle new 3.12 f-strings, hangs up completely #66

Open
crankedguy opened this issue Oct 27, 2023 · 6 comments
Open

Cannot handle new 3.12 f-strings, hangs up completely #66

crankedguy opened this issue Oct 27, 2023 · 6 comments

Comments

@crankedguy
Copy link

Hi,

your extension cannot handle new f-string capabilities of Python 3.12, writing a single line of code like this
f"https://ldomain.com.com{user["x1"]["x2"]["x3"]["x3"]["x5"]}",

makes the whole extension break down silently and stops it from any further formatting.
Only if you change the inside " to ' it works again.
But this is perfectly valid now in 3.12 and a massive improvement for using f-string. Please make it possible that your extension can handle that.. And on top does not just fail silently

Thanks

@EeyoreLee
Copy link
Owner

@crankedguy - yep, this should be added on the google/yapf side. It's issued here google/yapf. when yapf support this feature, I'll update the bundled yapf.

@crankedguy
Copy link
Author

thanks for the info. great, only open since two months...

@Spitfire1900
Copy link

Spitfire1900 commented Oct 30, 2023

@EeyoreLee The extension should still have error recovery without hanging + report an error to the user w/ stack trace in the Extension's output pane.

@crankedguy
Copy link
Author

crankedguy commented Oct 30, 2023

@EeyoreLee The extension should still have error recovery without hanging + report an error to the user w/ stack trace in the Extension's output pane.

this is one of the main problems that this does not happen
edit : clarification, main problem is that it is simply hanging itself up and ignoring the whole file if such a line occurs

@EeyoreLee
Copy link
Owner

The extension didn't hang up. It's still running, and just do nothing modification if yapf package raise a exception for a file. But it will indeed report an error in yapf extension output channel cause I think most of people won‘t look at it unless the extension doesn't work.

@crankedguy
Copy link
Author

@EeyoreLee You are right, I oversaw that in the specific output channel, however it is a bit of a burden that the whole file is affected by this,,, you cannot even disable that with # yapf: disable, yapf is just completely unusable for Python 3.12 at all then as far as I can see, if there is no other solution to circumvent that at least for portions of code

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