From 8f825060f1c168b913f2ac299ca48d4e9375f34d Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 27 Apr 2012 13:55:39 +0200 Subject: Check newly created consistency using _PyUnicode_CheckConsistency(str, 1) * In debug mode, fill the string data with invalid characters * Simplify also reference counting in PyCodec_BackslashReplaceErrors() and PyCodec_XMLCharRefReplaceError() --- Python/import.c | 1 + 1 file changed, 1 insertion(+) (limited to 'Python/import.c') diff --git a/Python/import.c b/Python/import.c index 8cf10e658c..103e7de439 100644 --- a/Python/import.c +++ b/Python/import.c @@ -992,6 +992,7 @@ make_source_pathname(PyObject *path) (j = dot0-right)); PyUnicode_WRITE(kind, data, i+j, 'p'); PyUnicode_WRITE(kind, data, i+j+1, 'y'); + assert(_PyUnicode_CheckConsistency(result, 1)); return result; } -- cgit v1.2.1