diff options
author | John Belmonte <john@neggie.net> | 2023-05-02 04:47:14 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-01 20:47:14 +0100 |
commit | 3ed8c882902a6982fd67e898a5b8a2d619fb5ddf (patch) | |
tree | 1ff3877549a81494f84a6ca36b0f47dd52768c75 /Objects/bytesobject.c | |
parent | 5078eedc5b18f0d208af6e30f60b33419132d1b6 (diff) | |
download | cpython-git-3ed8c882902a6982fd67e898a5b8a2d619fb5ddf.tar.gz |
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>
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r-- | Objects/bytesobject.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 27b2ad4f2c..e7e85cc19c 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -705,7 +705,6 @@ _PyBytes_FormatEx(const char *format, Py_ssize_t format_len, case ' ': flags |= F_BLANK; continue; case '#': flags |= F_ALT; continue; case '0': flags |= F_ZERO; continue; - case 'z': flags |= F_NO_NEG_0; continue; } break; } |