Skip to content

[pull] main from python:main - #1502

Merged
pull[bot] merged 2 commits into
tj-python:mainfrom
python:main
Sep 20, 2026
Merged

pull[bot] merged 2 commits into
tj-python:mainfrom
python:main

Conversation

@pull

@pull pull Bot commented Sep 20, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

tonghuaroot and others added 2 commits September 20, 2026 17:04
#153321)

The demo viewer read each script with open() and no encoding argument, i.e. the locale default encoding. That emits an EncodingWarning under -X warn_default_encoding and can mis-decode a script on a non-UTF-8 locale. Read the source with tokenize.open() instead, which decodes using the encoding detected from the file (its coding cookie, else UTF-8), matching how Python read the module when it was imported just above.

* gh-153319: Read turtledemo scripts as UTF-8

Per review, open the demo scripts with encoding='utf-8' instead of
tokenize.open(); the scripts are UTF-8.

---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
@pull pull Bot locked and limited conversation to collaborators Sep 20, 2026
@pull pull Bot added the ⤵️ pull label Sep 20, 2026
@pull
pull Bot merged commit 41d0922 into tj-python:main Sep 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants