We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
AssertionError on Ubuntu 18.04.2 LTS, Mackup 0.8.25, Python 3.6.7
I'm trying to `mackup restore` on a machine running

- Ubuntu 18.04.2 LTS
- Mackup 0.8.25
- Python 3.6.7

It fails immediately with the following:

```
Traceback (most recent call last):
  File "/home/REDACTED/.pyenv/versions/3.6.7/bin/mackup", line 10, in <module>
    sys.exit(main())
  File "/home/REDACTED/.pyenv/versions/3.6.7/lib/python3.6/site-packages/mackup/main.py", line 102, in main
    verbose)
  File "/home/REDACTED/.pyenv/versions/3.6.7/lib/python3.6/site-packages/mackup/application.py", line 26, in __init__
    assert isinstance(files, set)
AssertionError
```

I sync via dropbox, and to debug I made a tar.gz of the original mackup folder and copied/extracted it directly with no luck :( Not sure how to proceed to debug further, I've also tried `mackup restore -v` with no luck.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mackup/appsdb.py`
Content:
```
1 """
2 The applications database.
3 
4 The Applications Database provides an easy to use interface to load application
5 data from the Mackup Database (files).
6 """
7 import os
8 
9 try:
10     import configparser
11 except ImportError:
12     import ConfigParser as configparser
13 
14 
15 from .constants import APPS_DIR
16 from .constants import CUSTOM_APPS_DIR
17 
18 
19 class ApplicationsDatabase(object):
20 
21     """Database containing all the configured applications."""
22 
23     def __init__(self):
24         """Create a ApplicationsDatabase instance."""
25         # Build the dict that will contain the properties of each application
26         self.apps = dict()
27 
28         for config_file in ApplicationsDatabase.get_config_files():
29             config = configparser.SafeConfigParser(allow_no_value=True)
30 
31             # Needed to not lowercase the configuration_files in the ini files
32             config.optionxform = str
33 
34             if config.read(config_file):
35                 # Get the filename without the directory name
36                 filename = os.path.basename(config_file)
37                 # The app name is the cfg filename with the extension
38                 app_name = filename[:-len('.cfg')]
39 
40                 # Start building a dict for this app
41                 self.apps[app_name] = dict()
42 
43                 # Add the fancy name for the app, for display purpose
44                 app_pretty_name = config.get('application', 'name')
45                 self.apps[app_name]['name'] = app_pretty_name
46 
47                 # Add the configuration files to sync
48                 self.apps[app_name]['configuration_files'] = set()
49                 if config.has_section('configuration_files'):
50                     for path in config.options('configuration_files'):
51                         if path.startswith('/'):
52                             raise ValueError('Unsupported absolute path: {}'
53                                              .format(path))
54                         self.apps[app_name]['configuration_files'].add(path)
55 
56                 # Add the XDG configuration files to sync
57                 home = os.path.expanduser('~/')
58                 failobj = "{}.config".format(home)
59                 xdg_config_home = os.environ.get('XDG_CONFIG_HOME', failobj)
60                 if not xdg_config_home.startswith(home):
61                     raise ValueError('$XDG_CONFIG_HOME: {} must be '
62                                      'somewhere within your home '
63                                      'directory: {}'
64                                      .format(xdg_config_home, home))
65                 if config.has_section('xdg_configuration_files'):
66                     for path in config.options('xdg_configuration_files'):
67                         if path.startswith('/'):
68                             raise ValueError('Unsupported absolute path: '
69                                              '{}'
70                                              .format(path))
71                         path = os.path.join(xdg_config_home, path)
72                         path = path.replace(home, '')
73                         (self.apps[app_name]['configuration_files']
74                             .add(path))
75 
76     @staticmethod
77     def get_config_files():
78         """
79         Return the application configuration files.
80 
81         Return a list of configuration files describing the apps supported by
82         Mackup. The files returned are absolute full path to those files.
83         e.g. /usr/lib/mackup/applications/bash.cfg
84 
85         Only one config file per application should be returned, custom config
86         having a priority over stock config.
87 
88         Returns:
89             set of strings.
90         """
91         # Configure the config parser
92         apps_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
93                                 APPS_DIR)
94         custom_apps_dir = os.path.join(os.environ['HOME'], CUSTOM_APPS_DIR)
95 
96         # List of stock application config files
97         config_files = set()
98 
99         # Temp list of user added app config file names
100         custom_files = set()
101 
102         # Get the list of custom application config files first
103         if os.path.isdir(custom_apps_dir):
104             for filename in os.listdir(custom_apps_dir):
105                 if filename.endswith('.cfg'):
106                     config_files.add(os.path.join(custom_apps_dir,
107                                                   filename))
108                     # Also add it to the set of custom apps, so that we don't
109                     # add the stock config for the same app too
110                     custom_files.add(filename)
111 
112         # Add the default provided app config files, but only if those are not
113         # customized, as we don't want to overwrite custom app config.
114         for filename in os.listdir(apps_dir):
115             if filename.endswith('.cfg') and filename not in custom_files:
116                 config_files.add(os.path.join(apps_dir, filename))
117 
118         return config_files
119 
120     def get_name(self, name):
121         """
122         Return the fancy name of an application.
123 
124         Args:
125             name (str)
126 
127         Returns:
128             str
129         """
130         return self.apps[name]['name']
131 
132     def get_files(self, name):
133         """
134         Return the list of config files of an application.
135 
136         Args:
137             name (str)
138 
139         Returns:
140             set of str.
141         """
142         return sorted(self.apps[name]['configuration_files'])
143 
144     def get_app_names(self):
145         """
146         Return application names.
147 
148         Return the list of application names that are available in the
149         database.
150 
151         Returns:
152             set of str.
153         """
154         app_names = set()
155         for name in self.apps:
156             app_names.add(name)
157 
158         return app_names
159 
160     def get_pretty_app_names(self):
161         """
162         Return the list of pretty app names that are available in the database.
163 
164         Returns:
165             set of str.
166         """
167         pretty_app_names = set()
168         for app_name in self.get_app_names():
169             pretty_app_names.add(self.get_name(app_name))
170 
171         return pretty_app_names
172
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mackup/appsdb.py b/mackup/appsdb.py
--- a/mackup/appsdb.py
+++ b/mackup/appsdb.py
@@ -139,7 +139,7 @@
         Returns:
             set of str.
         """
-        return sorted(self.apps[name]['configuration_files'])
+        return self.apps[name]['configuration_files']
 
     def get_app_names(self):
         """

{"golden_diff": "diff --git a/mackup/appsdb.py b/mackup/appsdb.py\n--- a/mackup/appsdb.py\n+++ b/mackup/appsdb.py\n@@ -139,7 +139,7 @@\n         Returns:\n             set of str.\n         \"\"\"\n-        return sorted(self.apps[name]['configuration_files'])\n+        return self.apps[name]['configuration_files']\n \n     def get_app_names(self):\n         \"\"\"\n", "issue": "AssertionError on Ubuntu 18.04.2 LTS, Mackup 0.8.25, Python 3.6.7\nI'm trying to `mackup restore` on a machine running\r\n\r\n- Ubuntu 18.04.2 LTS\r\n- Mackup 0.8.25\r\n- Python 3.6.7\r\n\r\nIt fails immediately with the following:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/REDACTED/.pyenv/versions/3.6.7/bin/mackup\", line 10, in <module>\r\n    sys.exit(main())\r\n  File \"/home/REDACTED/.pyenv/versions/3.6.7/lib/python3.6/site-packages/mackup/main.py\", line 102, in main\r\n    verbose)\r\n  File \"/home/REDACTED/.pyenv/versions/3.6.7/lib/python3.6/site-packages/mackup/application.py\", line 26, in __init__\r\n    assert isinstance(files, set)\r\nAssertionError\r\n```\r\n\r\nI sync via dropbox, and to debug I made a tar.gz of the original mackup folder and copied/extracted it directly with no luck :( Not sure how to proceed to debug further, I've also tried `mackup restore -v` with no luck.\n", "before_files": [{"content": "\"\"\"\nThe applications database.\n\nThe Applications Database provides an easy to use interface to load application\ndata from the Mackup Database (files).\n\"\"\"\nimport os\n\ntry:\n    import configparser\nexcept ImportError:\n    import ConfigParser as configparser\n\n\nfrom .constants import APPS_DIR\nfrom .constants import CUSTOM_APPS_DIR\n\n\nclass ApplicationsDatabase(object):\n\n    \"\"\"Database containing all the configured applications.\"\"\"\n\n    def __init__(self):\n        \"\"\"Create a ApplicationsDatabase instance.\"\"\"\n        # Build the dict that will contain the properties of each application\n        self.apps = dict()\n\n        for config_file in ApplicationsDatabase.get_config_files():\n            config = configparser.SafeConfigParser(allow_no_value=True)\n\n            # Needed to not lowercase the configuration_files in the ini files\n            config.optionxform = str\n\n            if config.read(config_file):\n                # Get the filename without the directory name\n                filename = os.path.basename(config_file)\n                # The app name is the cfg filename with the extension\n                app_name = filename[:-len('.cfg')]\n\n                # Start building a dict for this app\n                self.apps[app_name] = dict()\n\n                # Add the fancy name for the app, for display purpose\n                app_pretty_name = config.get('application', 'name')\n                self.apps[app_name]['name'] = app_pretty_name\n\n                # Add the configuration files to sync\n                self.apps[app_name]['configuration_files'] = set()\n                if config.has_section('configuration_files'):\n                    for path in config.options('configuration_files'):\n                        if path.startswith('/'):\n                            raise ValueError('Unsupported absolute path: {}'\n                                             .format(path))\n                        self.apps[app_name]['configuration_files'].add(path)\n\n                # Add the XDG configuration files to sync\n                home = os.path.expanduser('~/')\n                failobj = \"{}.config\".format(home)\n                xdg_config_home = os.environ.get('XDG_CONFIG_HOME', failobj)\n                if not xdg_config_home.startswith(home):\n                    raise ValueError('$XDG_CONFIG_HOME: {} must be '\n                                     'somewhere within your home '\n                                     'directory: {}'\n                                     .format(xdg_config_home, home))\n                if config.has_section('xdg_configuration_files'):\n                    for path in config.options('xdg_configuration_files'):\n                        if path.startswith('/'):\n                            raise ValueError('Unsupported absolute path: '\n                                             '{}'\n                                             .format(path))\n                        path = os.path.join(xdg_config_home, path)\n                        path = path.replace(home, '')\n                        (self.apps[app_name]['configuration_files']\n                            .add(path))\n\n    @staticmethod\n    def get_config_files():\n        \"\"\"\n        Return the application configuration files.\n\n        Return a list of configuration files describing the apps supported by\n        Mackup. The files returned are absolute full path to those files.\n        e.g. /usr/lib/mackup/applications/bash.cfg\n\n        Only one config file per application should be returned, custom config\n        having a priority over stock config.\n\n        Returns:\n            set of strings.\n        \"\"\"\n        # Configure the config parser\n        apps_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),\n                                APPS_DIR)\n        custom_apps_dir = os.path.join(os.environ['HOME'], CUSTOM_APPS_DIR)\n\n        # List of stock application config files\n        config_files = set()\n\n        # Temp list of user added app config file names\n        custom_files = set()\n\n        # Get the list of custom application config files first\n        if os.path.isdir(custom_apps_dir):\n            for filename in os.listdir(custom_apps_dir):\n                if filename.endswith('.cfg'):\n                    config_files.add(os.path.join(custom_apps_dir,\n                                                  filename))\n                    # Also add it to the set of custom apps, so that we don't\n                    # add the stock config for the same app too\n                    custom_files.add(filename)\n\n        # Add the default provided app config files, but only if those are not\n        # customized, as we don't want to overwrite custom app config.\n        for filename in os.listdir(apps_dir):\n            if filename.endswith('.cfg') and filename not in custom_files:\n                config_files.add(os.path.join(apps_dir, filename))\n\n        return config_files\n\n    def get_name(self, name):\n        \"\"\"\n        Return the fancy name of an application.\n\n        Args:\n            name (str)\n\n        Returns:\n            str\n        \"\"\"\n        return self.apps[name]['name']\n\n    def get_files(self, name):\n        \"\"\"\n        Return the list of config files of an application.\n\n        Args:\n            name (str)\n\n        Returns:\n            set of str.\n        \"\"\"\n        return sorted(self.apps[name]['configuration_files'])\n\n    def get_app_names(self):\n        \"\"\"\n        Return application names.\n\n        Return the list of application names that are available in the\n        database.\n\n        Returns:\n            set of str.\n        \"\"\"\n        app_names = set()\n        for name in self.apps:\n            app_names.add(name)\n\n        return app_names\n\n    def get_pretty_app_names(self):\n        \"\"\"\n        Return the list of pretty app names that are available in the database.\n\n        Returns:\n            set of str.\n        \"\"\"\n        pretty_app_names = set()\n        for app_name in self.get_app_names():\n            pretty_app_names.add(self.get_name(app_name))\n\n        return pretty_app_names\n", "path": "mackup/appsdb.py"}], "after_files": [{"content": "\"\"\"\nThe applications database.\n\nThe Applications Database provides an easy to use interface to load application\ndata from the Mackup Database (files).\n\"\"\"\nimport os\n\ntry:\n    import configparser\nexcept ImportError:\n    import ConfigParser as configparser\n\n\nfrom .constants import APPS_DIR\nfrom .constants import CUSTOM_APPS_DIR\n\n\nclass ApplicationsDatabase(object):\n\n    \"\"\"Database containing all the configured applications.\"\"\"\n\n    def __init__(self):\n        \"\"\"Create a ApplicationsDatabase instance.\"\"\"\n        # Build the dict that will contain the properties of each application\n        self.apps = dict()\n\n        for config_file in ApplicationsDatabase.get_config_files():\n            config = configparser.SafeConfigParser(allow_no_value=True)\n\n            # Needed to not lowercase the configuration_files in the ini files\n            config.optionxform = str\n\n            if config.read(config_file):\n                # Get the filename without the directory name\n                filename = os.path.basename(config_file)\n                # The app name is the cfg filename with the extension\n                app_name = filename[:-len('.cfg')]\n\n                # Start building a dict for this app\n                self.apps[app_name] = dict()\n\n                # Add the fancy name for the app, for display purpose\n                app_pretty_name = config.get('application', 'name')\n                self.apps[app_name]['name'] = app_pretty_name\n\n                # Add the configuration files to sync\n                self.apps[app_name]['configuration_files'] = set()\n                if config.has_section('configuration_files'):\n                    for path in config.options('configuration_files'):\n                        if path.startswith('/'):\n                            raise ValueError('Unsupported absolute path: {}'\n                                             .format(path))\n                        self.apps[app_name]['configuration_files'].add(path)\n\n                # Add the XDG configuration files to sync\n                home = os.path.expanduser('~/')\n                failobj = \"{}.config\".format(home)\n                xdg_config_home = os.environ.get('XDG_CONFIG_HOME', failobj)\n                if not xdg_config_home.startswith(home):\n                    raise ValueError('$XDG_CONFIG_HOME: {} must be '\n                                     'somewhere within your home '\n                                     'directory: {}'\n                                     .format(xdg_config_home, home))\n                if config.has_section('xdg_configuration_files'):\n                    for path in config.options('xdg_configuration_files'):\n                        if path.startswith('/'):\n                            raise ValueError('Unsupported absolute path: '\n                                             '{}'\n                                             .format(path))\n                        path = os.path.join(xdg_config_home, path)\n                        path = path.replace(home, '')\n                        (self.apps[app_name]['configuration_files']\n                            .add(path))\n\n    @staticmethod\n    def get_config_files():\n        \"\"\"\n        Return the application configuration files.\n\n        Return a list of configuration files describing the apps supported by\n        Mackup. The files returned are absolute full path to those files.\n        e.g. /usr/lib/mackup/applications/bash.cfg\n\n        Only one config file per application should be returned, custom config\n        having a priority over stock config.\n\n        Returns:\n            set of strings.\n        \"\"\"\n        # Configure the config parser\n        apps_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),\n                                APPS_DIR)\n        custom_apps_dir = os.path.join(os.environ['HOME'], CUSTOM_APPS_DIR)\n\n        # List of stock application config files\n        config_files = set()\n\n        # Temp list of user added app config file names\n        custom_files = set()\n\n        # Get the list of custom application config files first\n        if os.path.isdir(custom_apps_dir):\n            for filename in os.listdir(custom_apps_dir):\n                if filename.endswith('.cfg'):\n                    config_files.add(os.path.join(custom_apps_dir,\n                                                  filename))\n                    # Also add it to the set of custom apps, so that we don't\n                    # add the stock config for the same app too\n                    custom_files.add(filename)\n\n        # Add the default provided app config files, but only if those are not\n        # customized, as we don't want to overwrite custom app config.\n        for filename in os.listdir(apps_dir):\n            if filename.endswith('.cfg') and filename not in custom_files:\n                config_files.add(os.path.join(apps_dir, filename))\n\n        return config_files\n\n    def get_name(self, name):\n        \"\"\"\n        Return the fancy name of an application.\n\n        Args:\n            name (str)\n\n        Returns:\n            str\n        \"\"\"\n        return self.apps[name]['name']\n\n    def get_files(self, name):\n        \"\"\"\n        Return the list of config files of an application.\n\n        Args:\n            name (str)\n\n        Returns:\n            set of str.\n        \"\"\"\n        return self.apps[name]['configuration_files']\n\n    def get_app_names(self):\n        \"\"\"\n        Return application names.\n\n        Return the list of application names that are available in the\n        database.\n\n        Returns:\n            set of str.\n        \"\"\"\n        app_names = set()\n        for name in self.apps:\n            app_names.add(name)\n\n        return app_names\n\n    def get_pretty_app_names(self):\n        \"\"\"\n        Return the list of pretty app names that are available in the database.\n\n        Returns:\n            set of str.\n        \"\"\"\n        pretty_app_names = set()\n        for app_name in self.get_app_names():\n            pretty_app_names.add(self.get_name(app_name))\n\n        return pretty_app_names\n", "path": "mackup/appsdb.py"}]}