This commit is contained in:
Jesse Bannon 2023-06-17 13:31:39 -07:00
parent 681bbd3c72
commit 3f3f73c5e6

View file

@ -47,13 +47,16 @@ else:
try: try:
lock_file = open(lock_file_path, "w", encoding="utf-8") lock_file = open(lock_file_path, "w", encoding="utf-8")
except FileNotFoundError as exc: except FileNotFoundError as exc:
# pylint: disable=line-too-long
raise ValidationException( raise ValidationException(
"Failed to create a file-lock to prevent multiple instances of ytdl-sub from " "Failed to create a file-lock to prevent multiple instances of ytdl-sub from "
"colliding with each other. If you get this error, it typically means it tried to " "colliding with each other. If you get this error, it typically means it tried to "
"create the file in a directory that is not a part of the same filesystem that " "create the file in a directory that is not a part of the same filesystem that "
"ytdl-sub is running on. See https://ytdl-sub.readthedocs.io/en/latest/config.html#ytdl_sub.config.config_validator.ConfigOptions.lock_directory " "ytdl-sub is running on. See "
"https://ytdl-sub.readthedocs.io/en/latest/config.html#ytdl_sub.config.config_validator.ConfigOptions.lock_directory "
"on how to change the directory that this lock gets written to." "on how to change the directory that this lock gets written to."
) from exc ) from exc
# pylint: enable=line-too-long
try: try:
fcntl.lockf(lock_file, fcntl.LOCK_EX | fcntl.LOCK_NB) fcntl.lockf(lock_file, fcntl.LOCK_EX | fcntl.LOCK_NB)