aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-06-22 22:59:16 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-06-29 11:28:08 +0200
commit3e396b3782813d36d46195564cd0e111422bcaf5 (patch)
treef315e990f71984745fcb8f22dac2f0e400fecadb /docs
parent28175bbee2c111cf41b80c97bbadd7dbabaa8990 (diff)
downloadmeson-3e396b3782813d36d46195564cd0e111422bcaf5.zip
meson-3e396b3782813d36d46195564cd0e111422bcaf5.tar.gz
meson-3e396b3782813d36d46195564cd0e111422bcaf5.tar.bz2
fix: Always explicitly set encoding for text files (fixes #8263)
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/genrelnotes.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/genrelnotes.py b/docs/genrelnotes.py
index 5dad924..082ab45 100755
--- a/docs/genrelnotes.py
+++ b/docs/genrelnotes.py
@@ -36,10 +36,10 @@ def add_to_sitemap(from_version, to_version):
Adds release note entry to sitemap.txt.
'''
sitemapfile = '../sitemap.txt'
- s_f = open(sitemapfile)
+ s_f = open(sitemapfile, encoding='utf-8')
lines = s_f.readlines()
s_f.close()
- with open(sitemapfile, 'w') as s_f:
+ with open(sitemapfile, 'w', encoding='utf-8') as s_f:
for line in lines:
if 'Release-notes' in line and from_version in line:
new_line = line.replace(from_version, to_version)
@@ -51,10 +51,10 @@ def generate(from_version, to_version):
Generate notes for Meson build next release.
'''
ofilename = f'Release-notes-for-{to_version}.md'
- with open(ofilename, 'w') as ofile:
+ with open(ofilename, 'w', encoding='utf-8') as ofile:
ofile.write(RELNOTE_TEMPLATE.format(to_version, to_version))
for snippetfile in glob('snippets/*.md'):
- snippet = open(snippetfile).read()
+ snippet = open(snippetfile, encoding='utf-8').read()
ofile.write(snippet)
if not snippet.endswith('\n'):
ofile.write('\n')