Skip to content

Commit 55c6cc4

Browse files
Issue #20033: makelocalealias.py now works with non-ASCII locales and produces
the same result as in 2.x.
1 parent a4d170d commit 55c6cc4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Tools/i18n/makelocalealias.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
def parse(filename):
1515

16-
f = open(filename)
17-
lines = f.read().splitlines()
16+
with open(filename, encoding='latin1') as f:
17+
lines = list(f)
1818
data = {}
1919
for line in lines:
2020
line = line.strip()
@@ -47,15 +47,15 @@ def parse(filename):
4747
def pprint(data):
4848
items = sorted(data.items())
4949
for k, v in items:
50-
print(' %-40s%r,' % ('%r:' % k, v))
50+
print(' %-40s%a,' % ('%a:' % k, v))
5151

5252
def print_differences(data, olddata):
5353
items = sorted(olddata.items())
5454
for k, v in items:
5555
if k not in data:
56-
print('# removed %r' % k)
56+
print('# removed %a' % k)
5757
elif olddata[k] != data[k]:
58-
print('# updated %r -> %r to %r' % \
58+
print('# updated %a -> %a to %a' % \
5959
(k, olddata[k], data[k]))
6060
# Additions are not mentioned
6161

0 commit comments

Comments
 (0)