Fix for literal null bytes -- these must be replaced by the four
characters \, 0, 0, 0.
This commit is contained in:
parent
72c2e1b56e
commit
b1908846af
@ -66,8 +66,9 @@ def escape(pattern):
|
|||||||
alphanum=string.letters+'_'+string.digits
|
alphanum=string.letters+'_'+string.digits
|
||||||
for char in pattern:
|
for char in pattern:
|
||||||
if char not in alphanum:
|
if char not in alphanum:
|
||||||
result.append('\\')
|
if char == '\000': result.append(r'\000')
|
||||||
result.append(char)
|
else: result.append('\\' + char)
|
||||||
|
else: result.append(char)
|
||||||
return string.join(result, '')
|
return string.join(result, '')
|
||||||
|
|
||||||
def compile(pattern, flags=0):
|
def compile(pattern, flags=0):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user