Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a3409489
Commit
a3409489
authored
Dec 23, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #20033: makelocalealias.py now works with non-ASCII locales and produces
the same result as in 2.x.
parents
2a614529
55c6cc40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Tools/i18n/makelocalealias.py
Tools/i18n/makelocalealias.py
+5
-5
No files found.
Tools/i18n/makelocalealias.py
View file @
a3409489
...
...
@@ -13,8 +13,8 @@ LOCALE_ALIAS = '/usr/share/X11/locale/locale.alias'
def
parse
(
filename
):
f
=
open
(
filename
)
lines
=
f
.
read
().
splitlines
(
)
with
open
(
filename
,
encoding
=
'latin1'
)
as
f
:
lines
=
list
(
f
)
data
=
{}
for
line
in
lines
:
line
=
line
.
strip
()
...
...
@@ -47,15 +47,15 @@ def parse(filename):
def
pprint
(
data
):
items
=
sorted
(
data
.
items
())
for
k
,
v
in
items
:
print
(
' %-40s%
r,'
%
(
'%r
:'
%
k
,
v
))
print
(
' %-40s%
a,'
%
(
'%a
:'
%
k
,
v
))
def
print_differences
(
data
,
olddata
):
items
=
sorted
(
olddata
.
items
())
for
k
,
v
in
items
:
if
k
not
in
data
:
print
(
'# removed %
r
'
%
k
)
print
(
'# removed %
a
'
%
k
)
elif
olddata
[
k
]
!=
data
[
k
]:
print
(
'# updated %
r -> %r to %r
'
%
\
print
(
'# updated %
a -> %a to %a
'
%
\
(
k
,
olddata
[
k
],
data
[
k
]))
# Additions are not mentioned
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment