# Buggy code
def set(self, key, value):
    """Store setting, but adding isn't allowed. All possible settings must be in default settings file."""
    key = key.lower()

    # Load user setting's values (for easy merging)
    user_values = {}
    for item in self._data:
        if "setting" in item and "value" in item:
            user_values[item["setting"].lower()] = item

    # Save setting
    if key in user_values:
        user_values[key]["value"] = value
    else:
        log.warn(
            "{} key '{}' not valid. The following are valid: {}".format(
                self.data_type, key, list(self._data.keys())
            )
        )


# 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 set(self, key, value):
    """Store setting, but adding isn't allowed. All possible settings must be in default settings file."""
    key = key.lower()

    # Load user setting's values (for easy merging)
    user_values = {}
    for item in self._data:
        if "setting" in item and "value" in item:
            user_values[item["setting"].lower()] = item

    # Save setting
    if key in user_values:
        user_values[key]["value"] = value
    else:
        log.warn(
            "{} key '{}' not valid. The following are valid: {}".format(
                self.data_type,
                key,
                list(self._data.keys()),
            )
        )