X Tutup
Skip to content

Commit 565ea8b

Browse files
committed
Fix building on LC_ALL=C locale
1 parent 6808a0a commit 565ea8b

11 files changed

+18
-18
lines changed

build_link_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def build_link_map(directory):
3838
link_map = LinkMap()
3939

4040
for fn in sorted(html_files):
41-
f = open(fn, "r")
41+
f = open(fn, "r", encoding='utf-8')
4242
text = f.read()
4343
f.close()
4444

fix_devhelp-links.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
target = '404'
4646
el.set('link', target)
4747

48-
out_f = open(out_fn, 'w')
48+
out_f = open(out_fn, 'w', encoding='utf-8')
4949
out_f.write(e.tostring(root, encoding='unicode', pretty_print=True))
5050
out_f.close()
5151

index2autolinker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
and the file name of the destination as the second ''')
5454
sys.exit(1)
5555

56-
out_f = open(sys.argv[2], 'w')
56+
out_f = open(sys.argv[2], 'w', encoding='utf-8')
5757

5858
groups = {}
5959
links = []

index2browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
and the file name of the destination as the second ''')
2828
sys.exit(1)
2929

30-
out_f = open(sys.argv[2], 'w')
30+
out_f = open(sys.argv[2], 'w', encoding='utf-8')
3131

3232
class Index2Browser(IndexTransform):
3333

index2ddg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def __init__(self, enabled=False, ident_match=None, debug_abstracts_path=None):
105105
self.stat_line_nums = []
106106
self.debug_abstracts_file = sys.stdout
107107
if debug_abstracts_path is not None:
108-
self.debug_abstracts_file = open(debug_abstracts_path, 'w')
108+
self.debug_abstracts_file = open(debug_abstracts_path, 'w', encoding='utf-8')
109109

110110
# track the statistics of number of lines used by the entries
111111
def submit_line_num(self, line_num):
@@ -524,7 +524,7 @@ def main():
524524

525525
redirects = []
526526

527-
out = open(output_file, 'w')
527+
out = open(output_file, 'w', encoding='utf-8')
528528

529529
#i=1
530530
for page in proc_ins:

index2devhelp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
in_fn = sys.argv[6]
4242
dest_fn = sys.argv[7]
4343

44-
out_f = open(dest_fn, 'w')
44+
out_f = open(dest_fn, 'w', encoding='utf-8')
4545

4646

4747
class Index2Devhelp(IndexTransform):
@@ -75,7 +75,7 @@ def process_item_hook(self, el, full_name, full_link):
7575
+ '" link="' + xml_escape(rel_link)
7676
+ '" version="2" language="c++">\n')
7777

78-
chapters_f = open(chapters_fn)
78+
chapters_f = open(chapters_fn, encoding='utf-8')
7979
out_f.write(chapters_f.read() + '\n')
8080
out_f.write('<functions>')
8181

index2doxygen-tag.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
indent_level_inc = 2
4242

43-
out_f = open(dest_fn, 'w')
43+
out_f = open(dest_fn, 'w', encoding='utf-8')
4444

4545
link_map = None
4646
if link_map_fn != 'web':
@@ -196,7 +196,7 @@ def process_item_hook(self, el, full_name, full_link):
196196
out_f.write('<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\n')
197197
out_f.write('<tagfile>\n')
198198

199-
with open(chapters_fn) as chapters_f:
199+
with open(chapters_fn, encoding='utf-8') as chapters_f:
200200
chapters_tree = etree.parse(chapters_f)
201201
for header_chapter in chapters_tree.getroot().findall(".//*[@name='Headers']/*"):
202202
out_f.write(' <compound kind="file">\n')

index2highlight.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
and the file name of the destination as the second ''')
2727
sys.exit(1)
2828

29-
out_f = open(sys.argv[2], 'w')
29+
out_f = open(sys.argv[2], 'w', encoding='utf-8')
3030

3131
class Index2Highlight(IndexTransform):
3232

index2search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
and the file name of the destination as the second ''')
2828
sys.exit(1)
2929

30-
out_f = open(sys.argv[2], 'w')
30+
out_f = open(sys.argv[2], 'w', encoding='utf-8')
3131

3232
class Index2Search(IndexTransform):
3333

link_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def write(self, fn):
4343
file_el.set('from', key)
4444
file_el.set('to', self.mapping[key])
4545

46-
out = open(fn, 'w')
46+
out = open(fn, 'w', encoding='utf-8')
4747
out.write('<?xml version="1.0" encoding="UTF-8"?>')
4848
out.write(e.tostring(root, encoding=str, pretty_print=True))
4949
out.close()

0 commit comments

Comments
 (0)
X Tutup