summaryrefslogtreecommitdiff
path: root/pylint/pyreverse/writer.py
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2021-07-28 20:18:44 +0200
committerGitHub <noreply@github.com>2021-07-28 20:18:44 +0200
commita8b7dd7bffe343f00bcd6409534edcab530a4fc4 (patch)
tree5f1d6b315ca95634a9328eed70603cfcfbac4e1c /pylint/pyreverse/writer.py
parentc04f92ef68e5ea779a60bfddb91dc677c5470fd0 (diff)
downloadpylint-git-a8b7dd7bffe343f00bcd6409534edcab530a4fc4.tar.gz
Add unspecified-encoding checker #3826 (#4753)
* Add unspecified-encoding checker #3826 This adds an unspecified-encoding checker that adds a warning whenever open() is called without an explicit encoding argument. This closes #3826 * Update tests to conform to unspecified-encoding With addition of the unspecified-encoding checker calls of open() need an encoding argument. Where necessary this argument has been added, or the message has been disabled. This also includes small linting changes to a small number of tests. Their test-data has been updated to reflect new line numbers. * Update scripts to conform to unspecified-encoding With addition of the unspecified-encoding checker calls of open() need an encoding argument. Where necessary this argument has been added. * Update pylint to conform to unspecified-encoding With addition of the unspecified-encoding checker calls of open() need an encoding argument. Where necessary this argument has been added. Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Diffstat (limited to 'pylint/pyreverse/writer.py')
-rw-r--r--pylint/pyreverse/writer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pylint/pyreverse/writer.py b/pylint/pyreverse/writer.py
index db54c3f0b..f45783c49 100644
--- a/pylint/pyreverse/writer.py
+++ b/pylint/pyreverse/writer.py
@@ -187,7 +187,9 @@ class VCGWriter(DiagramWriter):
def set_printer(self, file_name, basename):
"""initialize VCGWriter for a UML graph"""
- self.graph_file = open(file_name, "w+") # pylint: disable=consider-using-with
+ self.graph_file = open( # pylint: disable=consider-using-with
+ file_name, "w+", encoding="utf-8"
+ )
self.printer = VCGPrinter(self.graph_file)
self.printer.open_graph(
title=basename,