Replace ' and " characters in asset names

This commit is contained in:
Moritz Brückner 2021-03-27 00:30:05 +01:00
parent 8118733474
commit de8073732a

View file

@ -576,7 +576,7 @@ def safesrc(s):
def safestr(s: str) -> str:
"""Outputs a string where special characters have been replaced with
'_', which can be safely used in file and path names."""
for c in r'[]/\;,><&*:%=+@!#^()|?^':
for c in r'''[]/\;,><&*:%=+@!#^()|?^'"''':
s = s.replace(c, '_')
return ''.join([i if ord(i) < 128 else '_' for i in s])