fdf
This commit is contained in:
@@ -39,6 +39,7 @@ _WINDOWS_RESERVED_NAMES = {
|
||||
*(f"com{i}" for i in range(1, 10)),
|
||||
*(f"lpt{i}" for i in range(1, 10)),
|
||||
}
|
||||
_ILLEGAL_FILENAME_CHARS_RE = re.compile(r'[<>:"/\\|?*]')
|
||||
|
||||
|
||||
def _sanitize_filename_base(text: str) -> str:
|
||||
@@ -48,7 +49,7 @@ def _sanitize_filename_base(text: str) -> str:
|
||||
return "table"
|
||||
|
||||
# Replace characters illegal on Windows (and generally unsafe cross-platform).
|
||||
s = re.sub(r'[<>:"/\\|?*]', " ", s)
|
||||
s = _ILLEGAL_FILENAME_CHARS_RE.sub(" ", s)
|
||||
|
||||
# Drop control characters.
|
||||
s = "".join(ch for ch in s if ch.isprintable())
|
||||
|
||||
Reference in New Issue
Block a user