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

Fix makelocalealias.py for Python 3 #64232

Closed
serhiy-storchaka opened this issue Dec 20, 2013 · 3 comments
Closed

Fix makelocalealias.py for Python 3 #64232

serhiy-storchaka opened this issue Dec 20, 2013 · 3 comments
Assignees

Comments

@serhiy-storchaka
Copy link
Member

BPO 20033
Nosy @malemburg, @loewis, @pitrou, @serhiy-storchaka
Files
  • locale_py3k.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/serhiy-storchaka'
    closed_at = <Date 2013-12-23.16:57:26.427>
    created_at = <Date 2013-12-20.11:05:01.484>
    labels = []
    title = 'Fix makelocalealias.py for Python 3'
    updated_at = <Date 2013-12-24.07:03:18.012>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2013-12-24.07:03:18.012>
    actor = 'python-dev'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2013-12-23.16:57:26.427>
    closer = 'serhiy.storchaka'
    components = ['Demos and Tools']
    creation = <Date 2013-12-20.11:05:01.484>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['33230']
    hgrepos = []
    issue_num = 20033
    keywords = ['patch']
    message_count = 3.0
    messages = ['206675', '206824', '206888']
    nosy_count = 5.0
    nosy_names = ['lemburg', 'loewis', 'pitrou', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue20033'
    versions = ['Python 3.3', 'Python 3.4']

    @serhiy-storchaka
    Copy link
    Member Author

    When Tools/i18n/makelocalealias.py was ported to Python 3 some things were not fixed.

    1. locale.alias is opened as binary file in Python 2, but as text file (with locale encoding) in Python 3. This can cause fail when the script runs in UTF-8 locale because locale.alias contains non-ASCII locales ('bokmål' and 'français', encoded in Latin1).

    2. In Python 2 %r formatting always produce ASCII output. In Python 3 %a should be used to produce the same output.

    Proposed patch fixes these minor bugs.

    @pitrou
    Copy link
    Member

    pitrou commented Dec 22, 2013

    Sounds ok to me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Dec 24, 2013

    New changeset 22c59ddba494 by Serhiy Storchaka in branch '3.3':
    Issue bpo-20033: makelocalealias.py now works with non-ASCII locales and produces
    http://hg.python.org/cpython/rev/22c59ddba494

    New changeset 1287c570176b by Serhiy Storchaka in branch 'default':
    Issue bpo-20033: makelocalealias.py now works with non-ASCII locales and produces
    http://hg.python.org/cpython/rev/1287c570176b

    @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
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants