Merge pull request #2144 from MoritzBrueckner/fix-matnames

Replace ' and " characters in asset names
This commit is contained in:
Lubos Lenco 2021-03-27 09:04:25 +01:00 committed by GitHub
commit 4a784c70a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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])