summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 8ddc7ec..1f4e3dd 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -303,7 +303,9 @@ internal_print(PyObject *op, FILE *fp, int flags, int nesting)
}
else if (PyUnicode_Check(s)) {
PyObject *t;
- t = _PyUnicode_AsDefaultEncodedString(s, NULL);
+ t = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(s),
+ PyUnicode_GET_SIZE(s),
+ "backslashreplace");
if (t == NULL)
ret = 0;
else {