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
str.format() crashes #61844
Comments
Windows interpreter immediately crashes on this command:
>>> "{[{}]}".format({"{}": 5}) |
Confirmed on Linux too. This only affects 3.3+, on 2.7/3.2 it returns '5'. |
Here is a patch, which fixes the issue. This brings up rather subtle issues. For example you can have "{[{}]}" but not "{[{]}" as a format string. I wonder if having braces in the field name at all should be an error. |
Here's a more comprehensive patch. It follows the PEP by allowing "{" and "}" inside "[]" in the field name. |
The first patch looks better for me. It is simpler and I do not sure the thing is worth a complication. |
New changeset 6786e681ed58 by Benjamin Peterson in branch '3.3': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: