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

Skip to content

Commit 940c2b9

Browse files
committed
Merge pull request #1380 from dmcdougall/fix_svgio
Fix svg writer for StringIO objects
2 parents 58cc484 + 8c10735 commit 940c2b9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/matplotlib/backends/backend_svg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,8 @@ def print_svg(self, filename, *args, **kwargs):
10951095
svgwriter = io.TextIOWrapper(filename, 'utf-8')
10961096
else:
10971097
svgwriter = codecs.getwriter('utf-8')(filename)
1098+
else:
1099+
svgwriter = filename
10981100
fh_to_close = None
10991101
else:
11001102
raise ValueError("filename must be a path or a file-like object")

0 commit comments

Comments
 (0)