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

Skip to content

[Bug]: get_default_filename removes '0' from file name instead of '\0' from window title #29779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
htalaco opened this issue Mar 19, 2025 · 0 comments · Fixed by #29781
Closed
Milestone

Comments

@htalaco
Copy link

htalaco commented Mar 19, 2025

Bug summary

removed_chars = r'<>:"/|?\0 ' in get_default_filename has r before string so escape char '' is ignored in the string, so it just replace regular zero character '0' with '_'
just replace removed_chars = r'<>:"/|?
\0 ' with removed_chars = '<>:"/\|?*\0 '

removed_chars = r'<>:"/\|?*\0 '

Code for reproduction

# create a plot and set title to sth with 0 in it
fig.canvas.set_window_title('120')
# then click on save button

Actual outcome

It shows save dialog with 12_.png file name

Expected outcome

It should show save dialog with 120.png file name

Additional information

No response

Operating system

No response

Matplotlib Version

All

Matplotlib Backend

All

Python version

All

Jupyter version

All

Installation

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants