Add PTH107 mypy rule (#2933)
authorOzGav <gavnosp@hotmail.com>
Mon, 12 Jan 2026 13:37:04 +0000 (23:37 +1000)
committerGitHub <noreply@github.com>
Mon, 12 Jan 2026 13:37:04 +0000 (14:37 +0100)
music_assistant/helpers/named_pipe.py
pyproject.toml

index 7c9e1b30a0d226e730832261b9f4edf85e57e7fa..ac26ddb57d01f416ac59620f4bbeaca07e7333c5 100644 (file)
@@ -6,6 +6,7 @@ import asyncio
 import os
 import stat
 from contextlib import suppress
+from pathlib import Path
 
 
 class AsyncNamedPipeWriter:
@@ -35,7 +36,7 @@ class AsyncNamedPipeWriter:
                 file_stat = os.stat(self._pipe_path)
                 if not stat.S_ISFIFO(file_stat.st_mode):
                     # Not a FIFO - remove and recreate
-                    os.remove(self._pipe_path)
+                    Path(self._pipe_path).unlink()
                     os.mkfifo(self._pipe_path)
 
         await asyncio.to_thread(_create)
@@ -55,7 +56,7 @@ class AsyncNamedPipeWriter:
 
         def _remove() -> None:
             with suppress(Exception):
-                os.remove(self._pipe_path)
+                Path(self._pipe_path).unlink()
 
         await asyncio.to_thread(_remove)
 
index d79a28424730518f286195df04a4a7fdc418c163..140e177f1ef87d56f8ffade69e8de4725603a245 100644 (file)
@@ -245,7 +245,6 @@ ignore = [
   "RET507",
   "RUF006",
   "TRY300",
-  "PTH107",
   "S608",
   "N818",
   "S307",