# Buggy code
def load(self):
    """Load user settings file from disk, merging with allowed settings in default settings file.
    Creates user settings if missing."""

    # Default and user settings objects
    default_settings, user_settings = {}, {}

    # try to load default settings, on failure will raise exception to caller
    default_settings = self.read_from_file(self.default_settings_filename)

    # Try to find user settings file
    file_path = os.path.join(info.USER_PATH, self.settings_filename)

    # Load user settings (if found)
    if os.path.exists(os.fsencode(file_path)):
        # Will raise exception to caller on failure to read
        try:
            user_settings = self.read_from_file(file_path)
        except Exception as ex:
            log.error("Error loading settings file: %s" % ex)

            _ = QCoreApplication.instance()._tr
            QMessageBox.warning(
                None,
                _("Settings Error"),
                _("Error loading settings file: %(file_path)s. Settings will be reset.")
                % {"file_path": file_path},
            )
            user_settings = {}

    # Merge default and user settings, excluding settings not in default, Save settings
    self._data = self.merge_settings(default_settings, user_settings)

    # Return success of saving user settings file back after merge
    return self.write_to_file(file_path, self._data)


# Traceback (TypeError)
Loaded modules from: /home/chiller/Desktop/git-extern/openshot-qt/src
app:INFO ------------------------------------------------
app:INFO             Wed Aug 26 17:21:17 2020
app:INFO               Starting new session
app:INFO ------------------------------------------------
app:INFO          OpenShot (version 2.5.1-dev2)
app:INFO ------------------------------------------------
app:INFO openshot-qt version: 2.5.1-dev2
app:INFO libopenshot version: 0.2.5-dev2
app:INFO platform: Linux-4.19.0-10-amd64-x86_64-with-debian-10.5
app:INFO processor:
app:INFO machine: x86_64
app:INFO python version: 3.7.3
app:INFO qt5 version: 5.11.3
app:INFO pyqt5 version: 5.11.3
language:INFO Qt Detected Languages: ['en-US']
language:INFO LANG Environment Variable: en_US.UTF-8
language:INFO LOCALE Environment Variable:
language:INFO OpenShot Preference Language: Default
project_data:INFO Setting default profile to HD 720p 30 fps
app:INFO Setting font to /home/chiller/Desktop/git-extern/openshot-qt/src/images/fonts/Ubuntu-R.ttf
logger_libopenshot:INFO Connecting to libopenshot with debug port: 5556
app:INFO Setting custom dark theme
exceptions:ERROR Unhandled Exception
Traceback (most recent call last):
File "src/launch.py", line 143, in <module>
main()
File "src/launch.py", line 136, in main
app = OpenShotApp(argv)
File "/home/chiller/Desktop/git-extern/openshot-qt/src/classes/app.py", line 242, in __init__
from windows.main_window import MainWindow
File "/home/chiller/Desktop/git-extern/openshot-qt/src/windows/main_window.py", line 45, in <module>
from windows.views.timeline_webview import TimelineWebView
File "/home/chiller/Desktop/git-extern/openshot-qt/src/windows/views/timeline_webview.py", line 154, in <module>
class TimelineWebView(TimelineMixin, updates.UpdateInterface):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

# Fixed code
def load(self):
    """Load user settings file from disk, merging with allowed settings in default settings file.
    Creates user settings if missing."""

    # Default and user settings objects
    default_settings, user_settings = {}, {}

    # try to load default settings, on failure will raise exception to caller
    default_settings = self.read_from_file(self.default_settings_filename)

    # Try to find user settings file
    file_path = os.path.join(info.USER_PATH, self.settings_filename)

    # Load user settings (if found)
    if os.path.exists(os.fsencode(file_path)):
        # Will raise exception to caller on failure to read
        try:
            user_settings = self.read_from_file(file_path)
        except Exception as ex:
            log.error("Error loading settings file: %s", ex)
            user_settings = {}
            app = SettingStore.get_app()
            if app:
                # We have a parent, ask to show a message box
                app.settings_load_error(file_path)

    # Merge default and user settings, excluding settings not in default, Save settings
    self._data = self.merge_settings(default_settings, user_settings)

    # Return success of saving user settings file back after merge
    return self.write_to_file(file_path, self._data)