replace '0' bytes in strings when escaping
authorStefan Behnel <scoder@users.berlios.de>
Mon, 28 Apr 2008 10:20:02 +0000 (12:20 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Mon, 28 Apr 2008 10:20:02 +0000 (12:20 +0200)
Cython/Compiler/PyrexTypes.py

index 788495252579a26b3d6a4e4c22c2884725bcc298..dd300769d02674e6888c77f2c361c299157e6043 100644 (file)
@@ -877,6 +877,7 @@ class CEnumType(CType):
 
 
 def _escape_byte_string(s):
+    s = s.replace('\0', r'\x00')
     try:
         s.decode("ASCII")
         return s