From 2df5184c1f69dd9deb4c04639bac001da3f4c66d Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 28 Apr 2008 12:20:02 +0200 Subject: [PATCH] replace '0' bytes in strings when escaping --- Cython/Compiler/PyrexTypes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index 78849525..dd300769 100644 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -877,6 +877,7 @@ class CEnumType(CType): def _escape_byte_string(s): + s = s.replace('\0', r'\x00') try: s.decode("ASCII") return s -- 2.26.2