Roundup Robot added the comment:
New changeset 6786e681ed58 by Benjamin Peterson in branch '3.3':
only recursively expand in the format spec (closes #17644)
http://hg.python.org/cpython/rev/6786e681ed58
--
nosy: +python-dev
resolution: - fixed
stage: patch review - committed/rejected
Serhiy Storchaka added the comment:
The first patch looks better for me. It is simpler and I do not sure the thing
is worth a complication.
--
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
Changes by Serhiy Storchaka storch...@gmail.com:
--
keywords: +3.3regression
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17644
___
___
New submission from Anton Poldnev:
Windows interpreter immediately crashes on this command:
{[{}]}.format({{}: 5})
--
messages: 186130
nosy: poldnev
priority: normal
severity: normal
status: open
title: str.format() crashes
type: crash
versions: Python 3.3
Ezio Melotti added the comment:
Confirmed on Linux too. This only affects 3.3+, on 2.7/3.2 it returns '5'.
--
components: +Interpreter Core, Unicode
nosy: +eric.smith, ezio.melotti, haypo, serhiy.storchaka
priority: normal - high
stage: - needs patch
versions: +Python 3.4
Benjamin Peterson added the comment:
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.
--
keywords: +patch
nosy:
Benjamin Peterson added the comment:
Here's a more comprehensive patch. It follows the PEP by allowing { and }
inside [] in the field name.
--
Added file: http://bugs.python.org/file29693/fix_format_spec.patch
___
Python tracker
Mark Dickinson added the comment:
I wonder if having braces in the field name at all should be an error.
There's some discussion of this in issue #12014; e.g. msg137617. I'm not sure
what conclusion was reached. Eric?
--
nosy: +mark.dickinson