From: Stefan Behnel Date: Mon, 28 Apr 2008 10:20:02 +0000 (+0200) Subject: replace '0' bytes in strings when escaping X-Git-Tag: 0.9.6.14~12^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2df5184c1f69dd9deb4c04639bac001da3f4c66d;p=cython.git replace '0' bytes in strings when escaping --- 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