fdf
This commit is contained in:
@@ -20,7 +20,7 @@ This helper is intentionally minimal: one request at a time, last-write-wins.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
MEDEIA_MPV_HELPER_VERSION = "2026-03-22.6"
|
||||
MEDEIA_MPV_HELPER_VERSION = "2026-03-23.1"
|
||||
|
||||
import argparse
|
||||
import json
|
||||
@@ -1197,6 +1197,17 @@ def _acquire_ipc_lock(ipc_path: str) -> Optional[Any]:
|
||||
lock_path = _get_ipc_lock_path(ipc_path)
|
||||
fh = open(lock_path, "a+", encoding="utf-8", errors="replace")
|
||||
|
||||
# On Windows, locking a zero-length file can fail even when no process
|
||||
# actually owns the lock anymore. Prime the file with a single byte so
|
||||
# stale empty lock files do not wedge future helper startups.
|
||||
try:
|
||||
fh.seek(0, os.SEEK_END)
|
||||
if fh.tell() < 1:
|
||||
fh.write("\n")
|
||||
fh.flush()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if os.name == "nt":
|
||||
try:
|
||||
import msvcrt # type: ignore
|
||||
|
||||
Reference in New Issue
Block a user