From eeee80ec4ffc41a6cb4ac5ba1fc267cc6b556259 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 13 Nov 2023 19:22:12 +0000 Subject: [PATCH] Check cookie file has entries --- linkcheck/cookies.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linkcheck/cookies.py b/linkcheck/cookies.py index 5e17ef29..b97e8018 100644 --- a/linkcheck/cookies.py +++ b/linkcheck/cookies.py @@ -21,6 +21,8 @@ from http.cookiejar import split_header_words import email import requests +from . import LinkCheckerError + def from_file(filename): """Parse cookie data from a text file in HTTP header format. @@ -40,6 +42,8 @@ def from_file(filename): lines.append(line) if lines: entries.extend(from_headers("\r\n".join(lines))) + if not entries: + raise LinkCheckerError(_("No entries found")) return entries