This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2013年04月06日 14:46 by poldnev, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| fix_format_spec.patch | benjamin.peterson, 2013年04月06日 17:12 | review | ||
| fix_format_spec.patch | benjamin.peterson, 2013年04月06日 19:07 | review | ||
| Messages (7) | |||
|---|---|---|---|
| msg186130 - (view) | Author: Anton Poldnev (poldnev) | Date: 2013年04月06日 14:46 | |
Windows interpreter immediately crashes on this command:
>>> "{[{}]}".format({"{}": 5})
|
|||
| msg186131 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2013年04月06日 14:50 | |
Confirmed on Linux too. This only affects 3.3+, on 2.7/3.2 it returns '5'. |
|||
| msg186140 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2013年04月06日 17:12 | |
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.
|
|||
| msg186146 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2013年04月06日 19:07 | |
Here's a more comprehensive patch. It follows the PEP by allowing "{" and "}" inside "[]" in the field name.
|
|||
| msg186163 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2013年04月06日 20:04 | |
> 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? |
|||
| msg186211 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2013年04月07日 14:36 | |
The first patch looks better for me. It is simpler and I do not sure the thing is worth a complication. |
|||
| msg189490 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年05月17日 23:23 | |
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 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:43 | admin | set | github: 61844 |
| 2013年05月17日 23:23:06 | python-dev | set | status: open -> closed nosy: + python-dev messages: + msg189490 resolution: fixed stage: patch review -> resolved |
| 2013年04月07日 14:37:09 | serhiy.storchaka | set | keywords: + 3.3regression |
| 2013年04月07日 14:36:36 | serhiy.storchaka | set | messages:
+ msg186211 stage: needs patch -> patch review |
| 2013年04月06日 20:04:20 | mark.dickinson | set | nosy:
+ mark.dickinson messages: + msg186163 |
| 2013年04月06日 19:07:15 | benjamin.peterson | set | files:
+ fix_format_spec.patch messages: + msg186146 |
| 2013年04月06日 17:12:48 | benjamin.peterson | set | files:
+ fix_format_spec.patch nosy: + benjamin.peterson messages: + msg186140 keywords: + patch |
| 2013年04月06日 14:50:29 | ezio.melotti | set | priority: normal -> high components: + Interpreter Core, Unicode versions: + Python 3.4 nosy: + vstinner, eric.smith, ezio.melotti, serhiy.storchaka messages: + msg186131 stage: needs patch |
| 2013年04月06日 14:46:26 | poldnev | create | |