Commit b1908846 authored by Guido van Rossum's avatar Guido van Rossum

Fix for literal null bytes -- these must be replaced by the four

characters \, 0, 0, 0.
parent 72c2e1b5
......@@ -66,8 +66,9 @@ def escape(pattern):
alphanum=string.letters+'_'+string.digits
for char in pattern:
if char not in alphanum:
result.append('\\')
result.append(char)
if char == '\000': result.append(r'\000')
else: result.append('\\' + char)
else: result.append(char)
return string.join(result, '')
def compile(pattern, flags=0):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment