Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4356bfe

Browse files
committed
MNT: use the same replace chars on all OS
This makes the default suggested filename independent of the OS.
1 parent 7d2289d commit 4356bfe

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
@@ -2251,8 +2251,8 @@ def get_default_filename(self):
22512251
default_basename = default_basename or 'image'
22522252
# Characters to be avoided in a NT path:
22532253
# https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions
2254-
removed_chars = \
2255-
{"posix": " /\0", "nt": r'<>:"/\|?*\0'}.get(os.name, "_")
2254+
# plus ' '
2255+
removed_chars = r'<>:"/\|?*\0 '
22562256
default_basename = default_basename.translate(
22572257
{ord(c): "_" for c in removed_chars})
22582258
default_filetype = self.get_default_filetype()

0 commit comments

Comments
 (0)