From c76b96e7c92e3b2b6f11c36009a333dc437b7bcc Mon Sep 17 00:00:00 2001 From: Maxim Date: Sun, 6 Oct 2024 18:50:26 +0300 Subject: [PATCH] Update epub.py If I understood you correctly. When you are using the warning - 'In a future version we will set the default ignore_ncx option to True.' You want the user to explicitly choose how the toc.ncx file is used My proposal checks that the user explicitly selects the mode of operation rather than using the default. --- ebooklib/epub.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ebooklib/epub.py b/ebooklib/epub.py index 62fea67..5cfd605 100644 --- a/ebooklib/epub.py +++ b/ebooklib/epub.py @@ -1390,13 +1390,15 @@ def __init__(self, epub_file_name, options=None): self.opf_dir = '' self.options = dict(self.DEFAULT_OPTIONS) + self.user_provided_options = options or {} + if options: self.options.update(options) self._check_deprecated() def _check_deprecated(self): - if self.options.get('ignore_ncx') is None: + if 'ignore_ncx' not in self.user_provided_options: warnings.warn('In the future version we will turn default option ignore_ncx to True.') def process(self):