Skip to content

Commit 39379ea

Browse files
committed
MNT: use the same replace chars on all OS
This makes the default suggested filename independent of the OS.
1 parent 9088ee2 commit 39379ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2310,8 +2310,8 @@ def get_default_filename(self):
23102310
default_basename = self.get_window_title() or "image"
23112311
# Characters to be avoided in a NT path:
23122312
# https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions
2313-
removed_chars = \
2314-
{"posix": " /\0", "nt": r'<>:"/\|?*\0'}.get(os.name, "_")
2313+
# plus ' '
2314+
removed_chars = r'<>:"/\|?*\0 '
23152315
default_basename = default_basename.translate(
23162316
{ord(c): "_" for c in removed_chars})
23172317
default_filetype = self.get_default_filetype()

0 commit comments

Comments
 (0)