autotest: fix make_safe_filename for Valgrind

Valgrind treats this as a format string so the % is bad
This commit is contained in:
Peter Barker 2021-04-02 20:08:14 +11:00 committed by Peter Barker
parent 18ded114ae
commit 2c6bdd200c

View File

@ -228,7 +228,7 @@ def make_safe_filename(text):
"""Return a version of text safe for use as a filename."""
r = re.compile("([^a-zA-Z0-9_.+-])")
text.replace('/', '-')
filename = r.sub(lambda m: "%" + str(hex(ord(str(m.group(1))))).upper(), text)
filename = r.sub(lambda m: str(hex(ord(str(m.group(1))))).upper(), text)
return filename