From: YOKOTA Hiroshi <yokota.hgml@gmail.com>
Date: Sun, 9 Apr 2023 14:50:50 +0900
Subject: "ERROR: Unhandled exception" when opening Settings > Saving Books to
 disk (Closes: #1041779)

Forwarded: not-needed

Click "Preferences->Import/Export->Sending Books to disk" to
reproduce the error.

This is mostly same case of Debian bug 1034089 and 1032095.
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1034089
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1032095

----
calibre, version 6.13.0
ERROR: Unhandled exception: <b>TypeError</b>:SaveTemplate.__init__() got an unexpected keyword argument 'parent'

calibre 6.13  embedded-python: False
Linux-6.3.0-2-amd64-x86_64-with-glibc2.37 Linux ('64bit', 'ELF')
('Linux', '6.3.0-2-amd64', '#1 SMP PREEMPT_DYNAMIC Debian 6.3.11-1 (2023-07-01)')
Python 3.11.4
Interface language: None
Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/gui2/preferences/main.py", line 308, in show_plugin
    self.showing_widget = plugin.create_widget(self.scroll_area)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/calibre/calibre/customize/__init__.py", line 675, in create_widget
    return widget(parent)
           ^^^^^^^^^^^^^^
  File "/usr/lib/calibre/calibre/gui2/preferences/__init__.py", line 267, in __init__
    self.setupUi(self)
  File "/usr/lib/calibre/calibre/gui2/preferences/saving_ui.py", line 46, in setupUi
    self.save_template = SaveTemplate(parent=Form)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: SaveTemplate.__init__() got an unexpected keyword argument 'parent'

(the Preferences dialog does not open)
---
 src/calibre/gui2/preferences/save_template.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/calibre/gui2/preferences/save_template.py b/src/calibre/gui2/preferences/save_template.py
index 82cf951..47d4510 100644
--- a/src/calibre/gui2/preferences/save_template.py
+++ b/src/calibre/gui2/preferences/save_template.py
@@ -18,8 +18,8 @@ class SaveTemplate(QWidget, Ui_Form):
 
     changed_signal = pyqtSignal()
 
-    def __init__(self, *args):
-        QWidget.__init__(self, *args)
+    def __init__(self, parent=None):
+        QWidget.__init__(self, parent)
         Ui_Form.__init__(self)
         self.setupUi(self)
         self.orig_help_text = self.help_label.text()
