Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'oem' encoding #72146

Closed
zooba opened this issue Sep 5, 2016 · 12 comments
Closed

Add 'oem' encoding #72146

zooba opened this issue Sep 5, 2016 · 12 comments
Assignees
Labels
OS-windows type-feature A feature request or enhancement

Comments

@zooba
Copy link
Member

zooba commented Sep 5, 2016

BPO 27959
Nosy @pfmoore, @vstinner, @tjguk, @zware, @zooba
Files
  • 27959_1.patch
  • 27959_2.patch
  • 27959_3.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/zooba'
    closed_at = <Date 2016-09-07.02:48:30.530>
    created_at = <Date 2016-09-05.23:41:40.307>
    labels = ['type-feature', 'OS-windows']
    title = "Add 'oem' encoding"
    updated_at = <Date 2016-09-09.15:58:00.280>
    user = 'https://github.com/zooba'

    bugs.python.org fields:

    activity = <Date 2016-09-09.15:58:00.280>
    actor = 'steve.dower'
    assignee = 'steve.dower'
    closed = True
    closed_date = <Date 2016-09-07.02:48:30.530>
    closer = 'steve.dower'
    components = ['Windows']
    creation = <Date 2016-09-05.23:41:40.307>
    creator = 'steve.dower'
    dependencies = []
    files = ['44387', '44388', '44405']
    hgrepos = []
    issue_num = 27959
    keywords = ['patch']
    message_count = 12.0
    messages = ['274470', '274471', '274482', '274487', '274491', '274645', '274714', '274716', '274719', '274832', '275323', '275324']
    nosy_count = 6.0
    nosy_names = ['paul.moore', 'vstinner', 'tim.golden', 'python-dev', 'zach.ware', 'steve.dower']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue27959'
    versions = ['Python 3.6']

    @zooba
    Copy link
    Member Author

    zooba commented Sep 5, 2016

    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.

    @zooba zooba self-assigned this Sep 5, 2016
    @zooba
    Copy link
    Member Author

    zooba commented Sep 5, 2016

    While I'm here, should also move aliasmbcs from site.py into initialization - no reason for this behaviour to depend on importing site.

    @zooba
    Copy link
    Member Author

    zooba commented Sep 6, 2016

    Initial patch attached - tests to follow.

    @zooba
    Copy link
    Member Author

    zooba commented Sep 6, 2016

    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

    @zooba
    Copy link
    Member Author

    zooba commented Sep 6, 2016

    Addressed most of the feedback, though I think having a fallback search function instead of the alias is better.

    @vstinner
    Copy link
    Member

    vstinner commented Sep 6, 2016

    Rebased patch to get a review button.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 7, 2016

    New changeset c499690f606c by Steve Dower in branch 'default':
    Issue bpo-27959: Adds oem encoding, alias ansi to mbcs, move aliasmbcs to codec lookup
    https://hg.python.org/cpython/rev/c499690f606c

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 7, 2016

    New changeset fd0e62300fb7 by Steve Dower in branch 'default':
    Issue bpo-27959: Documents new encoding and alias.
    https://hg.python.org/cpython/rev/fd0e62300fb7

    @zooba zooba closed this as completed Sep 7, 2016
    @zooba zooba added the type-feature A feature request or enhancement label Sep 7, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 7, 2016

    New changeset 786c34bdc27a by Steve Dower in branch 'default':
    Issue bpo-27959: Updates NEWS and whatsnew
    https://hg.python.org/cpython/rev/786c34bdc27a

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 7, 2016

    New changeset 47b4dbd451f5 by Steve Dower in branch 'default':
    Issue bpo-27959: Prevent ImportError from escaping codec search function
    https://hg.python.org/cpython/rev/47b4dbd451f5

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 9, 2016

    New changeset 4e80a157ea66 by Steve Dower in branch 'default':
    Revert bpo-27959: ImportError within an encoding module should also skip the encoding
    https://hg.python.org/cpython/rev/4e80a157ea66

    @zooba
    Copy link
    Member Author

    zooba commented Sep 9, 2016

    Last commit was supposed to be for bpo-28005

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    OS-windows type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants