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

[core] Fix the byte string-format going over the specified byte limit #10068

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nurupo
Copy link

@nurupo nurupo commented May 30, 2024

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

The byte string-format's purpose is to limit the formatting string to be no more than N bytes. The byte string-format should be applied after the sanitization is done, as sanitize might replace a single byte character with a multi-byte one, e.g. '/' with '⧸', making the resulting string go over the desired byte limit.

Fixes #10060

Template

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

@nurupo nurupo force-pushed the fix-byte-string-format branch 3 times, most recently from 15df27f to 230115a Compare May 30, 2024 16:46
The byte string-format should be applied after the sanitization is done,
as sanitize might replace a single byte character with a multi-byte one,
e.g. '/' with '⧸', making the resulting string go over the desired byte
limit.

Fixes yt-dlp#10060
@nurupo nurupo marked this pull request as ready for review May 30, 2024 17:28
@bashonly bashonly added bug Bug that is not site-specific core-triage triage requested from a core dev labels May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that is not site-specific core-triage triage requested from a core dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The byte string format goes over the specified byte value if it's in a middle of a multi-byte utf-8 codepoint
2 participants