]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-104018: disallow "z" format specifier in %-format of byte strings (GH-104033)
authorJohn Belmonte <john@neggie.net>
Mon, 1 May 2023 19:47:14 +0000 (04:47 +0900)
committerGitHub <noreply@github.com>
Mon, 1 May 2023 19:47:14 +0000 (20:47 +0100)
commit3ed8c882902a6982fd67e898a5b8a2d619fb5ddf
tree1ff3877549a81494f84a6ca36b0f47dd52768c75
parent5078eedc5b18f0d208af6e30f60b33419132d1b6
gh-104018: disallow "z" format specifier in %-format of byte strings (GH-104033)

PEP-0682 specified that %-formatting would not support the "z" specifier,
but it was unintentionally allowed for bytes. This PR makes use of the "z"
flag an error for %-formatting in a bytestring.

Issue: #104018

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Lib/test/test_format.py
Misc/NEWS.d/next/Core and Builtins/2023-05-01-12-03-52.gh-issue-104018.PFxGS4.rst [new file with mode: 0644]
Objects/bytesobject.c