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.

Title: Remove support of format_string as keyword argument in string.Formatter().format()
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2017-01-07 11:35 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
string_formatter_positional_only.patch serhiy.storchaka, 2017-01-07 11:35 review
Pull Requests
URL Status Linked Edit
PR 552 closed dstufft, 2017-03-31 16:36
Messages (2)
msg284907 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-01-07 11:35
Passing a format string as a keyword argument to string.Formatter.format() was deprecated in 3.5 (issue23671). Proposed patch finishes the deprecation period and converts a warning to an error.

Python 3.5-3.6:

>>> string.Formatter().format(format_string='foo: {foo}', foo=123)
__main__:1: DeprecationWarning: Passing 'format_string' as keyword argument is deprecated
'foo: 123'

Python 3.7:

>>> string.Formatter().format(format_string='foo: {foo}', foo=123)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/cpython/Lib/", line 179, in format
    "argument: 'format_string'") from None
TypeError: format() missing 1 required positional argument: 'format_string'
msg285363 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2017-01-13 07:11
New changeset d571d8cd4258 by Serhiy Storchaka in branch 'default':
Issue #29193: A format string argument for string.Formatter.format()
Date User Action Args
2022-04-11 14:58:41adminsetgithub: 73379
2017-03-31 16:36:07dstufftsetpull_requests: + pull_request832
2017-01-13 07:11:32serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-01-13 07:11:07python-devsetnosy: + python-dev
messages: + msg285363
2017-01-13 07:06:33serhiy.storchakasetassignee: serhiy.storchaka
2017-01-07 11:35:11serhiy.storchakacreate