]> git.madduck.net Git - etc/vim.git/commit

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Fix an invalid quote escaping bug in f-string expressions (#3509)
authorYilei "Dolee" Yang <yileiyang@google.com>
Sun, 22 Jan 2023 13:27:11 +0000 (05:27 -0800)
committerGitHub <noreply@github.com>
Sun, 22 Jan 2023 13:27:11 +0000 (05:27 -0800)
commita36878eb2f375e2ac1e13052f663909f3835ec46
tree325038cb814e88ed1340a5730a40a531ac64a544
parenteabff673b37c5430d4cf72fa050a189a57be2deb
Fix an invalid quote escaping bug in f-string expressions (#3509)

Fixes #3506

We can't simply escape the quotes in a naked f-string when merging string groups, because backslashes are invalid.

The quotes in f-string expressions should be toggled (this is safe since quotes can't be reused).

This fix also means implicitly concatenated f-strings with different quotes can now be merged or quote-normalized by changing the quotes used in expressions. e.g.:

```diff
         raise sa_exc.UnboundExecutionError(
             "Could not locate a bind configured on "
-            f'{", ".join(context)} or this Session.'
+            f"{', '.join(context)} or this Session."
         )
```
CHANGES.md
src/black/trans.py
tests/data/preview/long_strings__regression.py