diff --git a/.pylintrc b/.pylintrc index e634a21..a076c68 100644 --- a/.pylintrc +++ b/.pylintrc @@ -2,4 +2,5 @@ [MESSAGES CONTROL] disable=all -enable=dangerous-default-value +enable=dangerous-default-value, + unspecified-encoding diff --git a/src/wuttjamaican/app.py b/src/wuttjamaican/app.py index c7d0e23..28dddcc 100644 --- a/src/wuttjamaican/app.py +++ b/src/wuttjamaican/app.py @@ -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 diff --git a/src/wuttjamaican/conf.py b/src/wuttjamaican/conf.py index 3eff415..3c16e2d 100644 --- a/src/wuttjamaican/conf.py +++ b/src/wuttjamaican/conf.py @@ -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 diff --git a/src/wuttjamaican/testing.py b/src/wuttjamaican/testing.py index 5d34960..3ec7ae8 100644 --- a/src/wuttjamaican/testing.py +++ b/src/wuttjamaican/testing.py @@ -95,7 +95,7 @@ class FileTestCase(TestCase): myconf = self.write_file('my.conf', '') """ 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