diff -r 17334c1d9245 Modules/_cursesmodule.c --- a/Modules/_cursesmodule.c Tue Oct 25 10:38:07 2016 +0300 +++ b/Modules/_cursesmodule.c Tue Oct 25 11:40:26 2016 +0300 @@ -230,7 +230,7 @@ PyCurses_ConvertToChtype(PyCursesWindowO encoding = win->encoding; else encoding = screen_encoding; - bytes = PyUnicode_AsEncodedObject(obj, encoding, NULL); + bytes = PyUnicode_AsEncodedString(obj, encoding, NULL); if (bytes == NULL) return 0; if (PyBytes_GET_SIZE(bytes) == 1) @@ -352,7 +352,7 @@ PyCurses_ConvertToString(PyCursesWindowO return 2; #else assert (wstr == NULL); - *bytes = PyUnicode_AsEncodedObject(obj, win->encoding, NULL); + *bytes = PyUnicode_AsEncodedString(obj, win->encoding, NULL); if (*bytes == NULL) return 0; return 1;