diff --git a/.vscode/settings.json b/.vscode/settings.json index ef14a3c0..de19fdfc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -25,7 +25,9 @@ "copyts", "cronsim", "datas", + "dateparser", "daterange", + "defusedxml", "dotenv", "edgechromium", "engineio", @@ -56,6 +58,7 @@ "movflags", "mpegts", "msvideo", + "multidict", "muxdelay", "nodesc", "noprogress", diff --git a/app/library/config.py b/app/library/config.py index 1c3d98a5..271feb07 100644 --- a/app/library/config.py +++ b/app/library/config.py @@ -539,7 +539,7 @@ class Config: try: import subprocess - branch_result = subprocess.run( # noqa: S603 + branch_result = subprocess.run( ["git", "rev-parse", "--abbrev-ref", "HEAD"], # noqa: S607 cwd=os.path.dirname(git_path), capture_output=True, @@ -556,7 +556,7 @@ class Config: logging.warning("Git branch name is empty.") return - commit_result = subprocess.run( # noqa: S603 + commit_result = subprocess.run( ["git", "log", "-1", "--format=%ct_%H"], # noqa: S607 cwd=os.path.dirname(git_path), capture_output=True, diff --git a/app/native.py b/app/native.py index 9aa302af..581a8fe2 100644 --- a/app/native.py +++ b/app/native.py @@ -1,5 +1,14 @@ #!/usr/bin/env python3 +import io +import os import sys + +os.environ["PYTHONUTF8"] = "1" + +if "utf-8" != sys.stdout.encoding.lower(): + sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8") + sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding="utf-8") + from pathlib import Path APP_ROOT = str((Path(__file__).parent / "..").resolve()) @@ -8,7 +17,6 @@ if APP_ROOT not in sys.path: import json -import os import queue import socket import threading diff --git a/pyproject.toml b/pyproject.toml index 0d827e3b..5c77e09c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -159,6 +159,7 @@ ignore = [ "ERA001", "S101", "LOG015", + "PLC0415", ] # Allow fix for all enabled rules (when `--fix`) is provided.