Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 802426f

Browse filesBrowse files
Issue #28526: Use PyUnicode_AsEncodedString() instead of
PyUnicode_AsEncodedObject() in _curese to ensure that the result is a bytes object.
2 parents b1152be + b29cee4 commit 802426f
Copy full SHA for 802426f

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

‎Modules/_cursesmodule.c

Copy file name to clipboardExpand all lines: Modules/_cursesmodule.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ PyCurses_ConvertToChtype(PyCursesWindowObject *win, PyObject *obj, chtype *ch)
230230
encoding = win->encoding;
231231
else
232232
encoding = screen_encoding;
233-
bytes = PyUnicode_AsEncodedObject(obj, encoding, NULL);
233+
bytes = PyUnicode_AsEncodedString(obj, encoding, NULL);
234234
if (bytes == NULL)
235235
return 0;
236236
if (PyBytes_GET_SIZE(bytes) == 1)
@@ -352,7 +352,7 @@ PyCurses_ConvertToString(PyCursesWindowObject *win, PyObject *obj,
352352
return 2;
353353
#else
354354
assert (wstr == NULL);
355-
*bytes = PyUnicode_AsEncodedObject(obj, win->encoding, NULL);
355+
*bytes = PyUnicode_AsEncodedString(obj, win->encoding, NULL);
356356
if (*bytes == NULL)
357357
return 0;
358358
return 1;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.