Skip to content

Revive sanitizing default filenames extracted from UI window titles - #28275

Merged
greglucas merged 2 commits into
matplotlib:mainfrom
tacaswell:revive_filenames
Jun 11, 2024
Merged

greglucas merged 2 commits into
matplotlib:mainfrom
tacaswell:revive_filenames

Conversation

@tacaswell

@tacaswell tacaswell commented May 22, 2024 •

Copy link
Copy Markdown
Member

This is a rebase of #9057 [edited to fix xref]

@tacaswell tacaswell added this to the v3.10.0 milestone May 22, 2024
@tacaswell tacaswell changed the title Revive filenames Revive sanitizing default filenames extracted from UI window titles May 22, 2024
@anntzer

anntzer commented May 22, 2024

Copy link
Copy Markdown
Contributor

Linked the wrong pr number.

Comment thread lib/matplotlib/backend_bases.py Resolved
Comment thread lib/matplotlib/backend_bases.py Resolved
anntzer and others added 2 commits June 11, 2024 10:39
I would actually think that we should not do any sanitization ("you get
what you asked for"), but given that there was some opposition last time
I tried to restore the space in the default filename ("Figure 1.png"),
even though the space is totally innocuous for the filesystem, we may as
well fix the filenames that are *actually* problematic.

Co-authored-by: Greg Lucas <greg.m.lucas@gmail.com>

MNT: remove unneeded access of savefig.directory
This makes the default suggested filename independent of the OS.
@tacaswell

Copy link
Copy Markdown
Member Author

The failures were real and the tests caught a behavior change (this method should really return a file name not the full path and the save_dir was only used for the de-duplication logic that has also been subsequently removed.

@greglucas
greglucas merged commit 14a04a0 into matplotlib:main Jun 11, 2024
@tacaswell
tacaswell deleted the revive_filenames branch June 11, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants