Repository navigation
Drop PYTHONIOENCODING for Python >= 3.16 - #1144
Merged
Merged
Conversation
tianon
approved these changes
Oct 23, 2026
tianon
left a comment
Member
There was a problem hiding this comment.
I managed to get a paperclip counter to reproduce the failure on 3.14 and below and it confirmed that it cannot reproduce on 3.15 and above even with this disabled 🥳
$ docker run --rm python:3.13-windowsservercore python -c 'print(chr(0x4e2d))'
中
$ docker run --rm --env PYTHONIOENCODING= python:3.13-windowsservercore python -c 'print(chr(0x4e2d))'
Traceback (most recent call last):
File "<string>", line 1, in <module>
print(chr(0x4e2d))
~~~~~^^^^^^^^^^^^^
File "C:\Python\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u4e2d' in position 0: character maps to <undefined>
$ docker run --rm --env PYTHONIOENCODING= python:3.15-windowsservercore python -c 'print(chr(0x4e2d))'
中
tianon
force-pushed
the
drop-pythonioencoding
branch
from
October 23, 2026 22:01
f7fd5df to
3f1d7a9
Compare
yosifkit
approved these changes
Oct 23, 2026
yosifkit
reviewed
Oct 23, 2026
Comment on lines
+19
to
+20
| # reproducer: docker run --rm python:{{ env.version }}-windowsservercore-{{ env.windowsRelease }} python -c 'print(chr(0x4e2d))' | ||
| # https://github.com/docker-library/python/pull/1144#pullrequestreview-5634536246 |
Member
There was a problem hiding this comment.
Do we really want to rebuild the rest of the windows images for a comment addition to the Dockerfile?
Member
There was a problem hiding this comment.
🤷 doesn't really bother me, but I can adjust if it bothers you
Member
There was a problem hiding this comment.
Seems a bit heavy, especially for windows image sizes.
tianon
force-pushed
the
drop-pythonioencoding
branch
from
October 23, 2026 22:24
3f1d7a9 to
21476be
Compare
docker-library-bot
added a commit
to docker-library-bot/official-images
that referenced
this pull request
Oct 23, 2026
Changes: - docker-library/python@d01180b5: Set LANG on all Linux variants again, including 3.13+ (docker-library/python#1145) - docker-library/python@6c812a5b: Drop PYTHONIOENCODING for Python >= 3.16 (docker-library/python#1144) - docker-library/python@bd0f6ae1: Add 3.16-rc windows variants (docker-library/python#1139)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per #1135 (comment):