From ee450093a9cebf99f186f69a14c7c36ff23b5b00 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 1 Dec 2011 02:52:11 +0100 Subject: [PATCH] PyCodec_IgnoreErrors() avoids the deprecated "u#" format --- Python/codecs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Python/codecs.c b/Python/codecs.c index cdf2c4455a3..9b0c4b2f446 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -510,8 +510,7 @@ PyObject *PyCodec_IgnoreErrors(PyObject *exc) wrong_exception_type(exc); return NULL; } - /* ouch: passing NULL, 0, pos gives None instead of u'' */ - return Py_BuildValue("(u#n)", &end, 0, end); + return Py_BuildValue("(Nn)", PyUnicode_New(0, 0), end); }