Skip to content

gh-140145: Improve error message of UnicodeEncodeError in zoneinfo.load_tzdata#140433

Merged
StanFromIreland merged 3 commits into
python:mainfrom
LamentXU123:Improve-error-message-of-zoneinfo
Jun 15, 2026
Merged

gh-140145: Improve error message of UnicodeEncodeError in zoneinfo.load_tzdata#140433
StanFromIreland merged 3 commits into
python:mainfrom
LamentXU123:Improve-error-message-of-zoneinfo

Conversation

@LamentXU123

@LamentXU123 LamentXU123 commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As Serhiy has explained in the issue, this is wrong.

@StanFromIreland

Copy link
Copy Markdown
Member

For example, on Unix you can see this with:

$ LC_ALL=C PYTHONUTF8=0 python3.14 - <<'EOF'
f = 'á.txt'
open(f, 'w')
EOF
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character '\xe1' in position 0: ordinal not in range(128)

@LamentXU123

LamentXU123 commented Oct 21, 2025

Copy link
Copy Markdown
Contributor Author

So shell we still separate this or just leave this alone?

I saw your comment at the issue.

@StanFromIreland

Copy link
Copy Markdown
Member

just leave this alone?

+1

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label May 1, 2026
@StanFromIreland

Copy link
Copy Markdown
Member

Closing as per issue.

@StanFromIreland

Copy link
Copy Markdown
Member

Oh, wait, this was updated after my request. Reopening.

@StanFromIreland StanFromIreland added skip news and removed stale Stale PR or inactive for long period of time. labels Jun 15, 2026
@StanFromIreland

Copy link
Copy Markdown
Member

I'll skip news, while technically user-visible, it's a tiny change and unlikely many see this case in practice.

@StanFromIreland StanFromIreland merged commit 585e14c into python:main Jun 15, 2026
55 checks passed
@StanFromIreland

Copy link
Copy Markdown
Member

Merged, thanks.

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.

3 participants