summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-05-01 20:18:29 (GMT)
committerGitHub <noreply@github.com>2023-05-01 20:18:29 (GMT)
commit10db28bfcf2b949e13312d0d2f1b3dd3c9585e69 (patch)
tree65cd7a07ef049ad70ff6f0bb9ab56d2d6876fc87 /Objects
parent723aacb7d5cf03b36c053c1f27fcfb3efdc9ae45 (diff)
downloadcpython-10db28bfcf2b949e13312d0d2f1b3dd3c9585e69.zip
cpython-10db28bfcf2b949e13312d0d2f1b3dd3c9585e69.tar.gz
cpython-10db28bfcf2b949e13312d0d2f1b3dd3c9585e69.tar.bz2
[3.11] gh-104018: disallow "z" format specifier in %-format of byte strings (GH-104033) (#104058)
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: GH-104018 --------- (cherry picked from commit 3ed8c882902a6982fd67e898a5b8a2d619fb5ddf) Co-authored-by: John Belmonte <john@neggie.net> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bytesobject.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 8dd1a2d..61cde0e 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -714,7 +714,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;
}