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.

Author SDesch
Recipients SDesch
Date 2021-11-03.11:55:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1635940547.79.0.60719103588.issue45704@roundup.psfhosted.org>
In-reply-to
Content
It appears when adding auto-numbered positional fields in python 3.1 `Formatter.parse` was not updated to handle them and currently returns an empty string as the field name.

```
list(Formatter().parse('hello {}'))  # [('hello ', '', '', None)]
```

This does not align with `Formatter.get_field` which according to the docs: "Given field_name as returned by parse() (see above), convert it to an object to be formatted."

When supplying an empty string to `.get_field()` you get a KeyError

```
Formatter().get_field("", [1, 2, 3], {}). # raises KeyError
```
History
Date User Action Args
2021-11-03 11:55:47SDeschsetrecipients: + SDesch
2021-11-03 11:55:47SDeschsetmessageid: <1635940547.79.0.60719103588.issue45704@roundup.psfhosted.org>
2021-11-03 11:55:47SDeschlinkissue45704 messages
2021-11-03 11:55:47SDeschcreate