You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
default filename does not strip invalid characters on windows #9056
When you then click on "save", the suggested file name is 2016-06-01t13:00_start.png. I would prefer 2016-06-01t13-00_start.png or a similar string replacement which is acceptable by the operating system.
changed the title [-]fig.canvas.set_window_title(title)[/-][+]fig.canvas.set_window_title(title) and save button do not work in harmony[/+]on Aug 18, 2017
The default filename is computed in FigureCanvasBase.get_default_filename. We already relpace ' ' with '_' because spaces in filename is just a bad idea, but do not do any other validation / cleanup
The exact work
add a conditional block to on windows do some extra clean up (check sys.platform)
add a windows-only test of this (using skipif on the test)
changed the title [-]fig.canvas.set_window_title(title) and save button do not work in harmony[/-][+]default filename does not strip invalid characters on windows [/+]on Aug 18, 2017
@1kastner Thanks for reporting this, the fix is pretty strait forward, but probably should be done by someone with a windows machine. Want to take a crack at it?
I'll add that if the window title somehow ends up with a \n character in it, clicking the "Save figure" button will fail silently (at least in the Windows qt4 backend - see hyperspy/hyperspy#1880 and hyperspy/hyperspy#1885). IMO this needs a fix; I'm not sure why the corresponding PR #9057 was closed.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
[-]fig.canvas.set_window_title(title)[/-][+]fig.canvas.set_window_title(title) and save button do not work in harmony[/+]tacaswell commentedon Aug 18, 2017
The default filename is computed in
FigureCanvasBase.get_default_filename. We already relpace' 'with'_'because spaces in filename is just a bad idea, but do not do any other validation / cleanupThe exact work
sys.platform)skipifon the test)[-]fig.canvas.set_window_title(title) and save button do not work in harmony[/-][+]default filename does not strip invalid characters on windows [/+]tacaswell commentedon Aug 18, 2017
@1kastner Thanks for reporting this, the fix is pretty strait forward, but probably should be done by someone with a windows machine. Want to take a crack at it?
1kastner commentedon Aug 18, 2017
I will have a look!
anntzer commentedon Aug 18, 2017
just made a PR :p
1kastner commentedon Aug 18, 2017
Wow, that was quick!
jat255 commentedon Mar 27, 2018
I'll add that if the window title somehow ends up with a
\ncharacter in it, clicking the "Save figure" button will fail silently (at least in the Windows qt4 backend - see hyperspy/hyperspy#1880 and hyperspy/hyperspy#1885). IMO this needs a fix; I'm not sure why the corresponding PR #9057 was closed.francisco-dlp commentedon Mar 28, 2018
Is there any agreement on how to fix this?
5 remaining items
github-actions commentedon May 22, 2024
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
tacaswell commentedon May 22, 2024
The patch in #9057 should probably be revived.
github-actions commentedon May 23, 2025
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
QuLogic commentedon May 28, 2025
#9057 was revived as #28275 and merged.