diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-06-15 11:31:09 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-06-15 11:31:09 +0000 |
| commit | fa12d8f79bed977ea1044152e687cc58a1485877 (patch) | |
| tree | aafdd336820012f7986e201a711fad437f854262 /tools/dev | |
| parent | d5ec6d160e017b660d9152d2675ef7704c967d31 (diff) | |
| download | docutils-fa12d8f79bed977ea1044152e687cc58a1485877.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/docutils@9072 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'tools/dev')
| -rwxr-xr-x | tools/dev/unicode2rstsubs.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/dev/unicode2rstsubs.py b/tools/dev/unicode2rstsubs.py index 1bc544df1..dd3d5371d 100755 --- a/tools/dev/unicode2rstsubs.py +++ b/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] |
