Skip to content

Conversation

@7amim
Copy link

@7amim 7amim commented Nov 7, 2025

What does this PR do?

This PR removes emojis from runtime-visible outputs (e.g., print(), logging.*(), and argparse help= strings).
On Windows systems using non-UTF-8 encodings such as cp1252 or GBK, these emojis can trigger:

UnicodeEncodeError: 'charmap' codec can't encode character ...

This makes CLI usage, example scripts, and some model conversion utilities crash on Windows.

This PR keeps behavior identical but replaces emojis with ASCII-safe text equivalents.

Removed emojis from:

  1. print() statements
  2. logging.info / warning / error / debug messages
  3. argparse help= strings
  4. Ensured all replacements are ASCII-safe and meaningful

Did not modify:

  1. Comments
  2. Docstrings
  3. Markdown files
  4. Example documentation text
  5. Tests containing emojis intentionally

Verified that Hugging Face’s logger formatting already automatically prefixes [INFO], [WARNING], [ERROR], etc.

Re-built the documents as instructed in guidelines.

Fixes #41945 (issue)

Before submitting

  • [N/A] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • [N/A] Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2025

[For maintainers] Suggested jobs to run (before merge)

run-slow: audio_spectrogram_transformer, bros, clipseg, dac, data2vec, deformable_detr, dinov2, dinov2_with_registers, donut, encodec, esm, fastspeech2_conformer

@7amim 7amim force-pushed the bugfix/remove_emojis_from_print branch from 264f841 to 489faa8 Compare November 8, 2025 03:31
@7amim 7amim marked this pull request as ready for review November 8, 2025 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider not using emojis in print, which encounterred encoding error.

1 participant