This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE: rewrite the code for handling file encoding
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: miss-islington, serhiy.storchaka, terry.reedy
Priority: normal Keywords: patch

Created on 2020-06-29 11:37 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 21215 merged serhiy.storchaka, 2020-06-29 11:54
PR 21259 closed miss-islington, 2020-07-01 15:10
PR 21260 merged miss-islington, 2020-07-01 15:10
PR 21267 merged miss-islington, 2020-07-01 18:06
Messages (7)
msg372563 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-06-29 11:37
The proposed patch rewrites the code in IDLE for detecting Python file encoding and decoding and encoding Python sources by using the tokenize module instead of handmade implementation of PEP 263.
msg372659 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-06-30 06:33
New changeset 694d31e714074176f0c324f95948b75dc768c091 by Serhiy Storchaka in branch 'master':
bpo-41158: IDLE: rewrite the code for handling file encoding (GH-21215)
https://github.com/python/cpython/commit/694d31e714074176f0c324f95948b75dc768c091
msg372686 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-06-30 12:27
Is there any reason the patch would not work with 3.9/3.8?
msg372736 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-07-01 08:27
No, it can be backported to 3.8 and 3.9 if you wish.
msg372759 - (view) Author: miss-islington (miss-islington) Date: 2020-07-01 15:29
New changeset fe0175f5b50967aae90cb759a0d2d016fb745584 by Miss Islington (bot) in branch '3.9':
bpo-41158: IDLE: rewrite the code for handling file encoding (GH-21215)
https://github.com/python/cpython/commit/fe0175f5b50967aae90cb759a0d2d016fb745584
msg372780 - (view) Author: miss-islington (miss-islington) Date: 2020-07-01 18:22
New changeset c3fa7534c7173d338880a1727f17795670518610 by Miss Islington (bot) in branch '3.8':
bpo-41158: IDLE: rewrite the code for handling file encoding (GH-21215)
https://github.com/python/cpython/commit/c3fa7534c7173d338880a1727f17795670518610
msg373666 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-07-15 04:16
#41300 reports that the new iomenu line 291
   enc, _ = tokenize.detect_encoding(io.BytesIO(encoded).readline)
fails without 'import io' added.  I should have tested more thoroughly.  I will fix and add tests there.
History
Date User Action Args
2022-04-11 14:59:33adminsetgithub: 85330
2020-07-15 04:16:06terry.reedysetmessages: + msg373666
2020-07-01 18:22:52miss-islingtonsetmessages: + msg372780
2020-07-01 18:06:55miss-islingtonsetpull_requests: + pull_request20416
2020-07-01 15:29:44miss-islingtonsetmessages: + msg372759
2020-07-01 15:10:13miss-islingtonsetpull_requests: + pull_request20408
2020-07-01 15:10:00miss-islingtonsetnosy: + miss-islington

pull_requests: + pull_request20407
2020-07-01 08:27:10serhiy.storchakasetmessages: + msg372736
2020-06-30 12:27:48terry.reedysetmessages: + msg372686
2020-06-30 06:48:59serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-06-30 06:33:29serhiy.storchakasetmessages: + msg372659
2020-06-29 11:54:00serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request20368
2020-06-29 11:37:57serhiy.storchakacreate