Skip to content

Commit bc7be3a

Browse files
committed
ci/check: Fix minor Python lints
1 parent ed90943 commit bc7be3a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

ci/check.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,24 @@ def handle_error(e):
5050
os.path.join('users', 'jlebon', 'id_rsa.pub'): 'ssh-rsa AAAAB',
5151
os.path.join('users', 'jlebon', 'id_ed25519.pub'): 'ssh-ed25519 AAAAC',
5252
os.path.join('users', 'miabbott', 'id_rsa.pub'): 'ssh-rsa AAAAB',
53-
# tutorial-containers.adoc, tutorial-setup.adoc, tutorial-updates.adoc, tutorial-user-systemd-unit-on-boot.adoc
53+
# tutorial-containers.adoc, tutorial-setup.adoc, tutorial-updates.adoc,
54+
# tutorial-user-systemd-unit-on-boot.adoc
5455
os.path.join('ssh-key.pub'): 'ssh-rsa AAAAB',
5556
}
5657

5758
ret = 0
5859
with tempfile.TemporaryDirectory() as tmpdocs:
5960
for path, contents in tmpfiles.items():
6061
os.makedirs(os.path.join(tmpdocs, os.path.dirname(path)), exist_ok=True)
61-
with open(os.path.join(tmpdocs, path), 'w') as fh:
62+
with open(os.path.join(tmpdocs, path), 'w', encoding="utf-8") as fh:
6263
fh.write(contents)
6364
for dirpath, dirnames, filenames in os.walk('.', onerror=handle_error):
6465
dirnames.sort() # walk in sorted order
6566
for filename in sorted(filenames):
6667
filepath = os.path.join(dirpath, filename)
6768
if not filename.endswith('.adoc'):
6869
continue
69-
with open(filepath) as fh:
70+
with open(filepath, encoding="utf-8") as fh:
7071
filedata = fh.read()
7172
# Iterate over YAML source blocks
7273
for match in matcher.finditer(filedata):

0 commit comments

Comments
 (0)