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: Add 'oem' encoding
Type: enhancement Stage: resolved
Components: Windows Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: steve.dower Nosy List: paul.moore, python-dev, steve.dower, tim.golden, vstinner, zach.ware
Priority: normal Keywords: patch

Created on 2016-09-05 23:41 by steve.dower, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
27959_1.patch steve.dower, 2016-09-06 00:33 review
27959_2.patch steve.dower, 2016-09-06 01:30
27959_3.patch vstinner, 2016-09-06 22:36 review
Messages (12)
msg274470 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-09-05 23:41
Currently the ANSI encoding is available on Windows as 'mbcs', however the OEM encoding (sometimes used by console-based applications) is not easily available.

The implementation is identical to PyUnicode_DecodeMBCS[Stateful], simply passing CP_OEM instead of CP_ACP.
msg274471 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-09-05 23:43
While I'm here, should also move `aliasmbcs` from site.py into initialization - no reason for this behaviour to depend on importing site.
msg274482 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-09-06 00:33
Initial patch attached - tests to follow.
msg274487 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-09-06 00:50
Forgot to include the oem.py file in that patch, but it's basically identical to mbcs.py except calling 'oem_encode' and 'oem_decode'. It'll be in the next one
msg274491 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-09-06 01:30
Addressed most of the feedback, though I think having a fallback search function instead of the alias is better.
msg274645 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-09-06 22:36
Rebased patch to get a review button.
msg274714 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-07 02:43
New changeset c499690f606c by Steve Dower in branch 'default':
Issue #27959: Adds oem encoding, alias ansi to mbcs, move aliasmbcs to codec lookup
https://hg.python.org/cpython/rev/c499690f606c
msg274716 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-07 02:47
New changeset fd0e62300fb7 by Steve Dower in branch 'default':
Issue #27959: Documents new encoding and alias.
https://hg.python.org/cpython/rev/fd0e62300fb7
msg274719 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-07 02:56
New changeset 786c34bdc27a by Steve Dower in branch 'default':
Issue #27959: Updates NEWS and whatsnew
https://hg.python.org/cpython/rev/786c34bdc27a
msg274832 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-07 16:33
New changeset 47b4dbd451f5 by Steve Dower in branch 'default':
Issue #27959: Prevent ImportError from escaping codec search function
https://hg.python.org/cpython/rev/47b4dbd451f5
msg275323 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-09 15:57
New changeset 4e80a157ea66 by Steve Dower in branch 'default':
Revert #27959: ImportError within an encoding module should also skip the encoding
https://hg.python.org/cpython/rev/4e80a157ea66
msg275324 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-09-09 15:58
Last commit was supposed to be for issue28005
History
Date User Action Args
2022-04-11 14:58:35adminsetgithub: 72146
2016-09-09 15:58:00steve.dowersetmessages: + msg275324
2016-09-09 15:57:13python-devsetmessages: + msg275323
2016-09-07 16:33:27python-devsetmessages: + msg274832
2016-09-07 02:56:12python-devsetmessages: + msg274719
2016-09-07 02:48:30steve.dowersetstatus: open -> closed
type: enhancement
resolution: fixed
stage: resolved
2016-09-07 02:47:00python-devsetmessages: + msg274716
2016-09-07 02:43:01python-devsetnosy: + python-dev
messages: + msg274714
2016-09-06 22:36:07vstinnersetfiles: + 27959_3.patch

messages: + msg274645
2016-09-06 01:30:41steve.dowersetfiles: + 27959_2.patch

messages: + msg274491
2016-09-06 00:50:52steve.dowersetmessages: + msg274487
2016-09-06 00:33:47steve.dowersetfiles: + 27959_1.patch
keywords: + patch
messages: + msg274482
2016-09-05 23:43:33steve.dowersetmessages: + msg274471
2016-09-05 23:41:40steve.dowercreate