classification
Title: Fix makelocalealias.py for Python 3
Type: Stage: resolved
Components: Demos and Tools Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: lemburg, loewis, pitrou, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2013-12-20 11:05 by serhiy.storchaka, last changed 2013-12-24 07:03 by python-dev. This issue is now closed.

Files
File name Uploaded Description Edit
locale_py3k.patch serhiy.storchaka, 2013-12-20 11:05 review
Messages (3)
msg206675 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-12-20 11:05
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.
msg206824 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-12-22 17:51
Sounds ok to me.
msg206888 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-12-24 07:03
New changeset 22c59ddba494 by Serhiy Storchaka in branch '3.3':
Issue #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 #20033: makelocalealias.py now works with non-ASCII locales and produces
http://hg.python.org/cpython/rev/1287c570176b
History
Date User Action Args
2013-12-24 07:03:18python-devsetnosy: + python-dev
messages: + msg206888
2013-12-23 16:57:26serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2013-12-22 17:51:57pitrousetnosy: + pitrou
messages: + msg206824

assignee: serhiy.storchaka
stage: commit review
2013-12-21 19:22:08serhiy.storchakalinkissue20046 dependencies
2013-12-20 11:05:01serhiy.storchakacreate