Skip to content
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

Defuse sia title characters #557

Merged
merged 2 commits into from
Jun 27, 2024

Conversation

msdemlei
Copy link
Contributor

@msdemlei msdemlei commented Jun 19, 2024

This is intended as a fix for bug #556. To keep things simple, I'm basing this on the branch of PR #553, because this plays in the vicinity of its code.

As mentioned in the commit message, one might argue we should lock down the file names more strongly than that. I'd be open to that, but only if people actually feel there is a sufficient need for that.

fixes #556

@bsipocz
Copy link
Member

bsipocz commented Jun 27, 2024

Rebased to resolve conflicts, and also removed the commit from the other PR as it has been merged already.

@bsipocz bsipocz force-pushed the defuse-sia-title-characters branch from 036a789 to 12f6f63 Compare June 27, 2024 21:28
@bsipocz bsipocz added this to the v1.6 milestone Jun 27, 2024
Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests need to be fixed for windows, for which I pushed a commit, otherwise this looks good to me.

Thank you!

@bsipocz bsipocz merged commit b44d2ec into astropy:main Jun 27, 2024
10 checks passed
@bsipocz
Copy link
Member

bsipocz commented Jun 27, 2024

Same as for #553, I change the milestone for the bugfix, if that comes out sooner than 1.6

@bsipocz bsipocz modified the milestones: v1.6, v1.5.3 Jun 27, 2024
@@ -894,6 +894,9 @@ def make_dataset_filename(self, *, dir=".", base=None, ext=None):
if not ext:
ext = self.suggest_extension(default="dat")

base = base.replace("/", "_"
).replace("\\", "_")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I would replace each \ with _ to correctly keep track of the replacements. Single \ might also create issues.
  2. I've noticed that suggest_dataset_basename fixes empty spaces too but this is not the case if base is present. Should we do this sanitization in one place (and potentially add more rules to it over time)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, I'm sorry for the premature merge then.

@msdemlei
Copy link
Contributor Author

msdemlei commented Jun 28, 2024 via email

@andamian
Copy link
Contributor

andamian commented Jul 2, 2024

Issue #573 - please feel free to add or change the details.

bsipocz added a commit that referenced this pull request Oct 14, 2024
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.

cachedataset hands through slashes in image titles to the file system
3 participants