Skip to content

Commit 90fec76

Browse files
committed
don't mutate a user's filename
if a user specifies ‘test.png’ as their filename, then don’t fuck with that! now, we were changing that to `’test.png.png’` if they also specified `format=‘png’`. sure, now they could set their filename `test.png` and their format `jpeg`, but that is their fault. this fixes the test, too.
1 parent 691b374 commit 90fec76

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

plotly/plotly/plotly.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,7 @@ def save_as(cls, figure_or_data, filename, format=None, width=None,
653653
elif ext and not format:
654654
format = ext[1:]
655655
elif not ext and format:
656-
filename += '.'+format
657-
else:
658-
filename += '.'+format
656+
filename += '.' + format
659657

660658
img = cls.get(figure_or_data, format, width, height)
661659

0 commit comments

Comments
 (0)