fix: fix 'unspecified-encoding' for pylint
This commit is contained in:
parent
ac65ec891b
commit
80bb905891
4 changed files with 6 additions and 5 deletions
|
@ -2,4 +2,5 @@
|
|||
|
||||
[MESSAGES CONTROL]
|
||||
disable=all
|
||||
enable=dangerous-default-value
|
||||
enable=dangerous-default-value,
|
||||
unspecified-encoding
|
||||
|
|
|
@ -464,7 +464,7 @@ class AppHandler:
|
|||
"""
|
||||
output = template.render(**context)
|
||||
if output_path:
|
||||
with open(output_path, 'wt') as f:
|
||||
with open(output_path, 'wt', encoding='utf_8') as f:
|
||||
f.write(output)
|
||||
return output
|
||||
|
||||
|
|
|
@ -274,7 +274,7 @@ class WuttaConfig:
|
|||
# re-write as temp file with "final" values
|
||||
fd, temp_path = tempfile.mkstemp(suffix='.ini')
|
||||
os.close(fd)
|
||||
with open(temp_path, 'wt') as f:
|
||||
with open(temp_path, 'wt', encoding='utf_8') as f:
|
||||
temp_config.write(f)
|
||||
|
||||
# and finally, load that into our main config
|
||||
|
@ -611,7 +611,7 @@ class WuttaConfig:
|
|||
# write INI file and return path
|
||||
fd, path = tempfile.mkstemp(suffix='.conf')
|
||||
os.close(fd)
|
||||
with open(path, 'wt') as f:
|
||||
with open(path, 'wt', encoding='utf_8') as f:
|
||||
parser.write(f)
|
||||
return path
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ class FileTestCase(TestCase):
|
|||
myconf = self.write_file('my.conf', '<file contents>')
|
||||
"""
|
||||
path = os.path.join(self.tempdir, filename)
|
||||
with open(path, 'wt') as f:
|
||||
with open(path, 'wt', encoding='utf_8') as f:
|
||||
f.write(content)
|
||||
return path
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue