Enable the PLW1514 lint in Ruff

This commit is contained in:
Adam Turner 2024-10-19 01:52:35 +01:00
parent 3920af4700
commit 43312ef8ac
3 changed files with 2 additions and 3 deletions

View File

@ -57,7 +57,6 @@ ignore = [
"PLR6201", # Use a set literal when testing for membership "PLR6201", # Use a set literal when testing for membership
"PLR6301", # Method `{method_name}` could be a function, class method, or static method "PLR6301", # Method `{method_name}` could be a function, class method, or static method
# pylint ('PLW') # pylint ('PLW')
"PLW1514", # `{function_name}` in text mode without explicit `encoding` argument
"PLW1641", # Object does not implement `__hash__` method "PLW1641", # Object does not implement `__hash__` method
"PLW2901", # Outer {outer_kind} variable `{name}` overwritten by inner {inner_kind} target "PLW2901", # Outer {outer_kind} variable `{name}` overwritten by inner {inner_kind} target
"PLW3201", # Dunder method `{name}` has no special meaning in Python 3 "PLW3201", # Dunder method `{name}` has no special meaning in Python 3

View File

@ -106,7 +106,7 @@ class Make:
try: try:
with chdir(self.build_dir_join('latex')): with chdir(self.build_dir_join('latex')):
if '-Q' in self.opts: if '-Q' in self.opts:
with open('__LATEXSTDOUT__', 'w') as outfile: with open('__LATEXSTDOUT__', 'w', encoding='utf-8') as outfile:
returncode = subprocess.call( returncode = subprocess.call(
[ [
makecmd, makecmd,

View File

@ -41,7 +41,7 @@ def save_traceback(app: Sphinx | None, exc: BaseException) -> str:
) )
with NamedTemporaryFile( with NamedTemporaryFile(
'w', suffix='.log', prefix='sphinx-err-', delete=False 'w', encoding='utf-8', suffix='.log', prefix='sphinx-err-', delete=False
) as f: ) as f:
f.write(f"""\ f.write(f"""\
# Platform: {sys.platform}; ({platform.platform()}) # Platform: {sys.platform}; ({platform.platform()})