Skip to content

Commit 3af8ce4

Browse files
committed
gh-161934: Assert text write buffers contain ASCII
1 parent 88a7145 commit 3af8ce4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎Modules/_io/textio.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,6 +1759,7 @@ textiowrapper_write_bytes(textio *self, PyObject *b,
17591759
{
17601760
Py_ssize_t bytes_len;
17611761
if (PyUnicode_Check(b)) {
1762+
assert(PyUnicode_IS_ASCII(b));
17621763
bytes_len = PyUnicode_GET_LENGTH(b);
17631764
}
17641765
else {

0 commit comments

Comments
 (0)