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

decks that are pure emoji download as "txt" instead of a sane filename #13238

Closed
vorpal-buildbot opened this issue Oct 17, 2024 · 8 comments · Fixed by #13501
Closed

decks that are pure emoji download as "txt" instead of a sane filename #13238

vorpal-buildbot opened this issue Oct 17, 2024 · 8 comments · Fixed by #13501
Labels
triage Used by bot to label unlabeled tasks, will be removed automatically upon labeling

Comments

@vorpal-buildbot
Copy link
Contributor

Reported on Discord by @bakert

@bakert
Copy link
Member

bakert commented Oct 17, 2024

@github-actions github-actions bot added the triage Used by bot to label unlabeled tasks, will be removed automatically upon labeling label Oct 17, 2024
@dunn
Copy link
Contributor

dunn commented Jan 11, 2025

am i right in thinking this isn't specific to emoji, but any deck names that are all non-ascii, since we have to put the filename in the content-disposition header and headers don't like non-ascii?

@bakert
Copy link
Member

bakert commented Jan 12, 2025

am i right in thinking this isn't specific to emoji, but any deck names that are all non-ascii, since we have to put the filename in the content-disposition header and headers don't like non-ascii?

Yes I think we probably explicitly filter down to just ascii although I haven't looked at the code in a while.

@dunn
Copy link
Contributor

dunn commented Jan 12, 2025

yeah, that's what's being done: https://github.com/PennyDreadfulMTG/Penny-Dreadful-Tools/blob/master/decksite/deck_name.py#L117

a quick fix would just check if safe_name ends up empty after filtering, and assign it something like untitled.

@bakert
Copy link
Member

bakert commented Jan 12, 2025

Sounds alright to me.

dunn added a commit to dunn/Penny-Dreadful-Tools that referenced this issue Jan 12, 2025
previously, a deck name with no safe (i.e. ascii) characters would lead to
file_name() returning an empty string, and the downloaded file being simply
`txt`

addresses PennyDreadfulMTG#13238
@silasary
Copy link
Member

Not sure if you want to, but we could throw it through anyascii to make a best-fit ascii name

dunn added a commit to dunn/Penny-Dreadful-Tools that referenced this issue Jan 12, 2025
previously, a deck name with no safe (i.e. ascii) characters would lead to
file_name() returning an empty string, and the downloaded file being simply
`txt`

addresses PennyDreadfulMTG#13238
@dunn
Copy link
Contributor

dunn commented Jan 12, 2025

Not sure if you want to, but we could throw it through anyascii to make a best-fit ascii name

oh neat, if we're ok pulling in another dependency that'd work. though we'd probably need a bit of post-processing (removing the colons around emoji names, etc)

dunn added a commit to dunn/Penny-Dreadful-Tools that referenced this issue Jan 12, 2025
previously, a deck name with no safe (i.e. ascii) characters would lead to
file_name() returning an empty string, and the downloaded file being simply
`txt`

addresses PennyDreadfulMTG#13238
@dunn
Copy link
Contributor

dunn commented Jan 13, 2025

oh, i missed that anyascii is already a dependency; opened a new PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Used by bot to label unlabeled tasks, will be removed automatically upon labeling
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants