Title: [Bug]: get_default_filename removes '0' from file name instead of '\0' from window title · Issue #29779 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: get_default_filename removes '0' from file name instead of '\0' from window title · Issue #29779 · matplotlib/matplotlib
X Title: [Bug]: get_default_filename removes '0' from file name instead of '\0' from window title · Issue #29779 · matplotlib/matplotlib
Description: 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 remo...
Open Graph Description: 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...
X Description: 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 characte...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29779
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: get_default_filename removes '0' from file name instead of '\\0' from window title","articleBody":"### Bug summary\n\nremoved_chars = r'\u003c\u003e:\"/\\|?*\\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 '_'\njust replace removed_chars = r'\u003c\u003e:\"/\\|?*\\0 ' with removed_chars = '\u003c\u003e:\"/\\\\|?*\\0 '\nhttps://github.com/matplotlib/matplotlib/blob/c887ecbc753763ff4232041cc84c9c6a44d20fd4/lib/matplotlib/backend_bases.py#L2223\n\n\n### Code for reproduction\n\n```Python\n# create a plot and set title to sth with 0 in it\nfig.canvas.set_window_title('120')\n# then click on save button\n```\n\n### Actual outcome\n\nIt shows save dialog with 12_.png file name\n\n### Expected outcome\n\nIt should show save dialog with 120.png file name\n\n### Additional information\n\n_No response_\n\n### Operating system\n\n_No response_\n\n### Matplotlib Version\n\nAll\n\n### Matplotlib Backend\n\nAll\n\n### Python version\n\nAll\n\n### Jupyter version\n\nAll\n\n### Installation\n\nNone","author":{"url":"https://github.com/htalaco","@type":"Person","name":"htalaco"},"datePublished":"2025-03-19T01:51:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/29779/matplotlib/issues/29779"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8576db12-be54-be0f-b51c-4608b58c6f2d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EBF0:39D6FF:2E000C1:3EAF29C:6A53D3C8 |
| html-safe-nonce | 660cbf1147d006fb8e02bffff07e74b15c4fd2cacf83b50b676a64af23bf0963 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkYwOjM5RDZGRjoyRTAwMEMxOjNFQUYyOUM6NkE1M0QzQzgiLCJ2aXNpdG9yX2lkIjoiNDU4MjgzMzg1MTU1MDkxMzQ4MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6729222a5ee5299ca2441cca1905e8b26e35227bb3335294662b5474c89db70a |
| hovercard-subject-tag | issue:2930225307 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/29779/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6e3036896a7ce8369c1a4f04eeba9d0e24af44658920e23d80eea47f76fab1c6/matplotlib/matplotlib/issues/29779 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6e3036896a7ce8369c1a4f04eeba9d0e24af44658920e23d80eea47f76fab1c6/matplotlib/matplotlib/issues/29779 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | htalaco |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width