summaryrefslogtreecommitdiff
path: root/docutils/tools/dev
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2022-06-15 11:31:09 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2022-06-15 11:31:09 +0000
commit99d22d8609c413384e3b38e923ca6cc456e7e631 (patch)
tree2fd37915bd2a9ae78a55d6dcc1a002b7eaae22a9 /docutils/tools/dev
parent34cefeef7b44bd4d9448c9c72137e380a31ae1b8 (diff)
downloaddocutils-99d22d8609c413384e3b38e923ca6cc456e7e631.tar.gz
Add encoding arguments when opening files.
Specify intended incoding, when possible. Avoids `EncodingWarning` in PEP 597 and nasty surprises if the default encoding is not what the user expects. Keep encoding unspecified where this may be an API change. Based on patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9072 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/tools/dev')
-rwxr-xr-xdocutils/tools/dev/unicode2rstsubs.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/docutils/tools/dev/unicode2rstsubs.py b/docutils/tools/dev/unicode2rstsubs.py
index 1bc544df1..dd3d5371d 100755
--- a/docutils/tools/dev/unicode2rstsubs.py
+++ b/docutils/tools/dev/unicode2rstsubs.py
@@ -169,7 +169,7 @@ class CharacterEntitySetExtractor:
outname = set_name + '-wide.txt'
else:
outname = set_name + '.txt'
- outfile = open(outname, 'w')
+ outfile = open(outname, 'w', encoding='ascii')
print('writing file "%s"' % outname)
outfile.write(self.header + '\n')
set = self.sets[set_name]