Skip to content

Commit 715f5da

Browse files
committed
MNT: use the same replace chars on all OS
This makes the default suggested filename independent of the OS.
1 parent 586697e commit 715f5da

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
@@ -2299,8 +2299,8 @@ def get_default_filename(self):
22992299
default_basename = self.get_window_title() or "image"
23002300
# Characters to be avoided in a NT path:
23012301
# https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions
2302-
removed_chars = \
2303-
{"posix": " /\0", "nt": r'<>:"/\|?*\0'}.get(os.name, "_")
2302+
# plus ' '
2303+
removed_chars = r'<>:"/\|?*\0 '
23042304
default_basename = default_basename.translate(
23052305
{ord(c): "_" for c in removed_chars})
23062306
default_filetype = self.get_default_filetype()

0 commit comments

Comments
 (0)