We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[core] idiot-proof Willie: prevent running as root
We should add a check in willie.py to refuse running willie as root.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `willie.py`
Content:
```
1 #!/usr/bin/env python2.7
2 #coding: utf8
3 """
4 Willie - An IRC Bot
5 Copyright 2008, Sean B. Palmer, inamidst.com
6 Copyright © 2012-2014, Elad Alfassa <elad@fedoraproject.org>
7 Licensed under the Eiffel Forum License 2.
8 
9 http://willie.dftba.net
10 """
11 from __future__ import unicode_literals
12 from __future__ import print_function
13 
14 import sys
15 from willie.tools import stderr
16 
17 if sys.version_info < (2, 7):
18     stderr('Error: Requires Python 2.7 or later. Try python2.7 willie')
19     sys.exit(1)
20 if sys.version_info.major == 3 and sys.version_info.minor < 3:
21     stderr('Error: When running on Python 3, Python 3.3 is required.')
22     sys.exit(1)
23 
24 import os
25 import argparse
26 import signal
27 
28 from willie.__init__ import run
29 from willie.config import Config, create_config, ConfigurationError, wizard
30 import willie.tools as tools
31 import willie.web
32 
33 homedir = os.path.join(os.path.expanduser('~'), '.willie')
34 
35 def enumerate_configs(extension='.cfg'):
36     configfiles = []
37     if os.path.isdir(homedir):
38         willie_dotdirfiles = os.listdir(homedir)  # Preferred
39         for item in willie_dotdirfiles:
40             if item.endswith(extension):
41                 configfiles.append(item)
42 
43     return configfiles
44 
45 
46 def find_config(name, extension='.cfg'):
47     if os.path.isfile(name):
48         return name
49     configs = enumerate_configs(extension)
50     if name in configs or name + extension in configs:
51         if name + extension in configs:
52             name = name + extension
53 
54     return os.path.join(homedir, name)
55 
56 
57 def main(argv=None):
58     global homedir
59     # Step One: Parse The Command Line
60     try:
61         parser = argparse.ArgumentParser(description='Willie IRC Bot',
62                                          usage='%(prog)s [options]')
63         parser.add_argument('-c', '--config', metavar='filename',
64                             help='use a specific configuration file')
65         parser.add_argument("-d", '--fork', action="store_true",
66                           dest="deamonize", help="Deamonize willie")
67         parser.add_argument("-q", '--quit', action="store_true", dest="quit",
68                           help="Gracefully quit Willie")
69         parser.add_argument("-k", '--kill', action="store_true", dest="kill",
70                           help="Kill Willie")
71         parser.add_argument('--exit-on-error', action="store_true",
72                           dest="exit_on_error", help=(
73                               "Exit immediately on every error instead of "
74                               "trying to recover"))
75         parser.add_argument("-l", '--list', action="store_true",
76                           dest="list_configs",
77                           help="List all config files found")
78         parser.add_argument("-m", '--migrate', action="store_true",
79                           dest="migrate_configs",
80                           help="Migrate config files to the new format")
81         parser.add_argument('--quiet', action="store_true", dest="quiet",
82                           help="Supress all output")
83         parser.add_argument('-w', '--configure-all', action='store_true',
84                           dest='wizard', help='Run the configuration wizard.')
85         parser.add_argument('--configure-modules', action='store_true',
86                           dest='mod_wizard', help=(
87                               'Run the configuration wizard, but only for the '
88                               'module configuration options.'))
89         parser.add_argument('--configure-database', action='store_true',
90                           dest='db_wizard', help=(
91                               'Run the configuration wizard, but only for the '
92                               'database configuration options.'))
93         opts = parser.parse_args()
94 
95         if opts.wizard:
96             wizard('all', opts.config)
97             return
98         elif opts.mod_wizard:
99             wizard('mod', opts.config)
100             return
101         elif opts.db_wizard:
102             wizard('db', opts.config)
103             return
104 
105         if opts.list_configs:
106             configs = enumerate_configs()
107             print('Config files in ~/.willie:')
108             if len(configs) is 0:
109                 print('\tNone found')
110             else:
111                 for config in configs:
112                     print('\t%s' % config)
113             print('-------------------------')
114             return
115 
116         config_name = opts.config or 'default'
117 
118         configpath = find_config(config_name)
119         if not os.path.isfile(configpath):
120             print("Welcome to Willie!\nI can't seem to find the configuration file, so let's generate it!\n")
121             if not configpath.endswith('.cfg'):
122                 configpath = configpath + '.cfg'
123             create_config(configpath)
124             configpath = find_config(config_name)
125         try:
126             config_module = Config(configpath)
127         except ConfigurationError as e:
128             stderr(e)
129             sys.exit(2)
130 
131         if config_module.core.not_configured:
132             stderr('Bot is not configured, can\'t start')
133             # exit with code 2 to prevent auto restart on fail by systemd
134             sys.exit(2)
135 
136         if not config_module.has_option('core', 'homedir'):
137             config_module.dotdir = homedir
138             config_module.homedir = homedir
139         else:
140             homedir = config_module.core.homedir
141             config_module.dotdir = config_module.core.homedir
142 
143         if not config_module.core.logdir:
144             config_module.core.logdir = os.path.join(homedir, 'logs')
145         logfile = os.path.os.path.join(config_module.logdir, 'stdio.log')
146         if not os.path.isdir(config_module.logdir):
147             os.mkdir(config_module.logdir)
148 
149         config_module.exit_on_error = opts.exit_on_error
150 
151         sys.stderr = tools.OutputRedirect(logfile, True, opts.quiet)
152         sys.stdout = tools.OutputRedirect(logfile, False, opts.quiet)
153 
154         #Handle --quit, --kill and saving the PID to file
155         pid_dir = config_module.core.pid_dir or homedir
156         if opts.config is None:
157             pid_file_path = os.path.join(pid_dir, 'willie.pid')
158         else:
159             basename = os.path.basename(opts.config)
160             if basename.endswith('.cfg'):
161                 basename = basename[:-4]
162             pid_file_path = os.path.join(pid_dir, 'willie-%s.pid' % basename)
163         if os.path.isfile(pid_file_path):
164             pid_file = open(pid_file_path, 'r')
165             old_pid = int(pid_file.read())
166             pid_file.close()
167             if tools.check_pid(old_pid):
168                 if not opts.quit and not opts.kill:
169                     stderr('There\'s already a Willie instance running with this config file')
170                     stderr('Try using the --quit or the --kill options')
171                     sys.exit(1)
172                 elif opts.kill:
173                     stderr('Killing the willie')
174                     os.kill(old_pid, signal.SIGKILL)
175                     sys.exit(0)
176                 elif opts.quit:
177                     stderr('Signaling Willie to stop gracefully')
178                     if hasattr(signal, 'SIGUSR1'):
179                         os.kill(old_pid, signal.SIGUSR1)
180                     else:
181                         os.kill(old_pid, signal.SIGTERM)
182                     sys.exit(0)
183             elif not tools.check_pid(old_pid) and (opts.kill or opts.quit):
184                 stderr('Willie is not running!')
185                 sys.exit(1)
186         elif opts.quit or opts.kill:
187             stderr('Willie is not running!')
188             sys.exit(1)
189         if opts.deamonize:
190             child_pid = os.fork()
191             if child_pid is not 0:
192                 sys.exit()
193         pid_file = open(pid_file_path, 'w')
194         pid_file.write(str(os.getpid()))
195         pid_file.close()
196         config_module.pid_file_path = pid_file_path
197 
198         # Step Five: Initialise And Run willie
199         run(config_module)
200     except KeyboardInterrupt:
201         print("\n\nInterrupted")
202         os._exit(1)
203 if __name__ == '__main__':
204     main()
205
```
--- 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/willie.py b/willie.py
--- a/willie.py
+++ b/willie.py
@@ -92,6 +92,14 @@
                               'database configuration options.'))
         opts = parser.parse_args()
 
+        try:
+            if os.getuid() == 0 or os.geteuid() == 0:
+                stderr('Error: Do not run Willie with root privileges.')
+                sys.exit(1)
+        except AttributeError:
+            # Windows don't have os.getuid/os.geteuid
+            pass
+
         if opts.wizard:
             wizard('all', opts.config)
             return

{"golden_diff": "diff --git a/willie.py b/willie.py\n--- a/willie.py\n+++ b/willie.py\n@@ -92,6 +92,14 @@\n                               'database configuration options.'))\n         opts = parser.parse_args()\n \n+        try:\n+            if os.getuid() == 0 or os.geteuid() == 0:\n+                stderr('Error: Do not run Willie with root privileges.')\n+                sys.exit(1)\n+        except AttributeError:\n+            # Windows don't have os.getuid/os.geteuid\n+            pass\n+\n         if opts.wizard:\n             wizard('all', opts.config)\n             return\n", "issue": "[core] idiot-proof Willie: prevent running as root\nWe should add a check in willie.py to refuse running willie as root.\n\n", "before_files": [{"content": "#!/usr/bin/env python2.7\n#coding: utf8\n\"\"\"\nWillie - An IRC Bot\nCopyright 2008, Sean B. Palmer, inamidst.com\nCopyright \u00a9 2012-2014, Elad Alfassa <elad@fedoraproject.org>\nLicensed under the Eiffel Forum License 2.\n\nhttp://willie.dftba.net\n\"\"\"\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\n\nimport sys\nfrom willie.tools import stderr\n\nif sys.version_info < (2, 7):\n    stderr('Error: Requires Python 2.7 or later. Try python2.7 willie')\n    sys.exit(1)\nif sys.version_info.major == 3 and sys.version_info.minor < 3:\n    stderr('Error: When running on Python 3, Python 3.3 is required.')\n    sys.exit(1)\n\nimport os\nimport argparse\nimport signal\n\nfrom willie.__init__ import run\nfrom willie.config import Config, create_config, ConfigurationError, wizard\nimport willie.tools as tools\nimport willie.web\n\nhomedir = os.path.join(os.path.expanduser('~'), '.willie')\n\ndef enumerate_configs(extension='.cfg'):\n    configfiles = []\n    if os.path.isdir(homedir):\n        willie_dotdirfiles = os.listdir(homedir)  # Preferred\n        for item in willie_dotdirfiles:\n            if item.endswith(extension):\n                configfiles.append(item)\n\n    return configfiles\n\n\ndef find_config(name, extension='.cfg'):\n    if os.path.isfile(name):\n        return name\n    configs = enumerate_configs(extension)\n    if name in configs or name + extension in configs:\n        if name + extension in configs:\n            name = name + extension\n\n    return os.path.join(homedir, name)\n\n\ndef main(argv=None):\n    global homedir\n    # Step One: Parse The Command Line\n    try:\n        parser = argparse.ArgumentParser(description='Willie IRC Bot',\n                                         usage='%(prog)s [options]')\n        parser.add_argument('-c', '--config', metavar='filename',\n                            help='use a specific configuration file')\n        parser.add_argument(\"-d\", '--fork', action=\"store_true\",\n                          dest=\"deamonize\", help=\"Deamonize willie\")\n        parser.add_argument(\"-q\", '--quit', action=\"store_true\", dest=\"quit\",\n                          help=\"Gracefully quit Willie\")\n        parser.add_argument(\"-k\", '--kill', action=\"store_true\", dest=\"kill\",\n                          help=\"Kill Willie\")\n        parser.add_argument('--exit-on-error', action=\"store_true\",\n                          dest=\"exit_on_error\", help=(\n                              \"Exit immediately on every error instead of \"\n                              \"trying to recover\"))\n        parser.add_argument(\"-l\", '--list', action=\"store_true\",\n                          dest=\"list_configs\",\n                          help=\"List all config files found\")\n        parser.add_argument(\"-m\", '--migrate', action=\"store_true\",\n                          dest=\"migrate_configs\",\n                          help=\"Migrate config files to the new format\")\n        parser.add_argument('--quiet', action=\"store_true\", dest=\"quiet\",\n                          help=\"Supress all output\")\n        parser.add_argument('-w', '--configure-all', action='store_true',\n                          dest='wizard', help='Run the configuration wizard.')\n        parser.add_argument('--configure-modules', action='store_true',\n                          dest='mod_wizard', help=(\n                              'Run the configuration wizard, but only for the '\n                              'module configuration options.'))\n        parser.add_argument('--configure-database', action='store_true',\n                          dest='db_wizard', help=(\n                              'Run the configuration wizard, but only for the '\n                              'database configuration options.'))\n        opts = parser.parse_args()\n\n        if opts.wizard:\n            wizard('all', opts.config)\n            return\n        elif opts.mod_wizard:\n            wizard('mod', opts.config)\n            return\n        elif opts.db_wizard:\n            wizard('db', opts.config)\n            return\n\n        if opts.list_configs:\n            configs = enumerate_configs()\n            print('Config files in ~/.willie:')\n            if len(configs) is 0:\n                print('\\tNone found')\n            else:\n                for config in configs:\n                    print('\\t%s' % config)\n            print('-------------------------')\n            return\n\n        config_name = opts.config or 'default'\n\n        configpath = find_config(config_name)\n        if not os.path.isfile(configpath):\n            print(\"Welcome to Willie!\\nI can't seem to find the configuration file, so let's generate it!\\n\")\n            if not configpath.endswith('.cfg'):\n                configpath = configpath + '.cfg'\n            create_config(configpath)\n            configpath = find_config(config_name)\n        try:\n            config_module = Config(configpath)\n        except ConfigurationError as e:\n            stderr(e)\n            sys.exit(2)\n\n        if config_module.core.not_configured:\n            stderr('Bot is not configured, can\\'t start')\n            # exit with code 2 to prevent auto restart on fail by systemd\n            sys.exit(2)\n\n        if not config_module.has_option('core', 'homedir'):\n            config_module.dotdir = homedir\n            config_module.homedir = homedir\n        else:\n            homedir = config_module.core.homedir\n            config_module.dotdir = config_module.core.homedir\n\n        if not config_module.core.logdir:\n            config_module.core.logdir = os.path.join(homedir, 'logs')\n        logfile = os.path.os.path.join(config_module.logdir, 'stdio.log')\n        if not os.path.isdir(config_module.logdir):\n            os.mkdir(config_module.logdir)\n\n        config_module.exit_on_error = opts.exit_on_error\n\n        sys.stderr = tools.OutputRedirect(logfile, True, opts.quiet)\n        sys.stdout = tools.OutputRedirect(logfile, False, opts.quiet)\n\n        #Handle --quit, --kill and saving the PID to file\n        pid_dir = config_module.core.pid_dir or homedir\n        if opts.config is None:\n            pid_file_path = os.path.join(pid_dir, 'willie.pid')\n        else:\n            basename = os.path.basename(opts.config)\n            if basename.endswith('.cfg'):\n                basename = basename[:-4]\n            pid_file_path = os.path.join(pid_dir, 'willie-%s.pid' % basename)\n        if os.path.isfile(pid_file_path):\n            pid_file = open(pid_file_path, 'r')\n            old_pid = int(pid_file.read())\n            pid_file.close()\n            if tools.check_pid(old_pid):\n                if not opts.quit and not opts.kill:\n                    stderr('There\\'s already a Willie instance running with this config file')\n                    stderr('Try using the --quit or the --kill options')\n                    sys.exit(1)\n                elif opts.kill:\n                    stderr('Killing the willie')\n                    os.kill(old_pid, signal.SIGKILL)\n                    sys.exit(0)\n                elif opts.quit:\n                    stderr('Signaling Willie to stop gracefully')\n                    if hasattr(signal, 'SIGUSR1'):\n                        os.kill(old_pid, signal.SIGUSR1)\n                    else:\n                        os.kill(old_pid, signal.SIGTERM)\n                    sys.exit(0)\n            elif not tools.check_pid(old_pid) and (opts.kill or opts.quit):\n                stderr('Willie is not running!')\n                sys.exit(1)\n        elif opts.quit or opts.kill:\n            stderr('Willie is not running!')\n            sys.exit(1)\n        if opts.deamonize:\n            child_pid = os.fork()\n            if child_pid is not 0:\n                sys.exit()\n        pid_file = open(pid_file_path, 'w')\n        pid_file.write(str(os.getpid()))\n        pid_file.close()\n        config_module.pid_file_path = pid_file_path\n\n        # Step Five: Initialise And Run willie\n        run(config_module)\n    except KeyboardInterrupt:\n        print(\"\\n\\nInterrupted\")\n        os._exit(1)\nif __name__ == '__main__':\n    main()\n", "path": "willie.py"}], "after_files": [{"content": "#!/usr/bin/env python2.7\n#coding: utf8\n\"\"\"\nWillie - An IRC Bot\nCopyright 2008, Sean B. Palmer, inamidst.com\nCopyright \u00a9 2012-2014, Elad Alfassa <elad@fedoraproject.org>\nLicensed under the Eiffel Forum License 2.\n\nhttp://willie.dftba.net\n\"\"\"\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\n\nimport sys\nfrom willie.tools import stderr\n\nif sys.version_info < (2, 7):\n    stderr('Error: Requires Python 2.7 or later. Try python2.7 willie')\n    sys.exit(1)\nif sys.version_info.major == 3 and sys.version_info.minor < 3:\n    stderr('Error: When running on Python 3, Python 3.3 is required.')\n    sys.exit(1)\n\nimport os\nimport argparse\nimport signal\n\nfrom willie.__init__ import run\nfrom willie.config import Config, create_config, ConfigurationError, wizard\nimport willie.tools as tools\nimport willie.web\n\nhomedir = os.path.join(os.path.expanduser('~'), '.willie')\n\ndef enumerate_configs(extension='.cfg'):\n    configfiles = []\n    if os.path.isdir(homedir):\n        willie_dotdirfiles = os.listdir(homedir)  # Preferred\n        for item in willie_dotdirfiles:\n            if item.endswith(extension):\n                configfiles.append(item)\n\n    return configfiles\n\n\ndef find_config(name, extension='.cfg'):\n    if os.path.isfile(name):\n        return name\n    configs = enumerate_configs(extension)\n    if name in configs or name + extension in configs:\n        if name + extension in configs:\n            name = name + extension\n\n    return os.path.join(homedir, name)\n\n\ndef main(argv=None):\n    global homedir\n    # Step One: Parse The Command Line\n    try:\n        parser = argparse.ArgumentParser(description='Willie IRC Bot',\n                                         usage='%(prog)s [options]')\n        parser.add_argument('-c', '--config', metavar='filename',\n                            help='use a specific configuration file')\n        parser.add_argument(\"-d\", '--fork', action=\"store_true\",\n                          dest=\"deamonize\", help=\"Deamonize willie\")\n        parser.add_argument(\"-q\", '--quit', action=\"store_true\", dest=\"quit\",\n                          help=\"Gracefully quit Willie\")\n        parser.add_argument(\"-k\", '--kill', action=\"store_true\", dest=\"kill\",\n                          help=\"Kill Willie\")\n        parser.add_argument('--exit-on-error', action=\"store_true\",\n                          dest=\"exit_on_error\", help=(\n                              \"Exit immediately on every error instead of \"\n                              \"trying to recover\"))\n        parser.add_argument(\"-l\", '--list', action=\"store_true\",\n                          dest=\"list_configs\",\n                          help=\"List all config files found\")\n        parser.add_argument(\"-m\", '--migrate', action=\"store_true\",\n                          dest=\"migrate_configs\",\n                          help=\"Migrate config files to the new format\")\n        parser.add_argument('--quiet', action=\"store_true\", dest=\"quiet\",\n                          help=\"Supress all output\")\n        parser.add_argument('-w', '--configure-all', action='store_true',\n                          dest='wizard', help='Run the configuration wizard.')\n        parser.add_argument('--configure-modules', action='store_true',\n                          dest='mod_wizard', help=(\n                              'Run the configuration wizard, but only for the '\n                              'module configuration options.'))\n        parser.add_argument('--configure-database', action='store_true',\n                          dest='db_wizard', help=(\n                              'Run the configuration wizard, but only for the '\n                              'database configuration options.'))\n        opts = parser.parse_args()\n\n        try:\n            if os.getuid() == 0 or os.geteuid() == 0:\n                stderr('Error: Do not run Willie with root privileges.')\n                sys.exit(1)\n        except AttributeError:\n            # Windows don't have os.getuid/os.geteuid\n            pass\n\n        if opts.wizard:\n            wizard('all', opts.config)\n            return\n        elif opts.mod_wizard:\n            wizard('mod', opts.config)\n            return\n        elif opts.db_wizard:\n            wizard('db', opts.config)\n            return\n\n        if opts.list_configs:\n            configs = enumerate_configs()\n            print('Config files in ~/.willie:')\n            if len(configs) is 0:\n                print('\\tNone found')\n            else:\n                for config in configs:\n                    print('\\t%s' % config)\n            print('-------------------------')\n            return\n\n        config_name = opts.config or 'default'\n\n        configpath = find_config(config_name)\n        if not os.path.isfile(configpath):\n            print(\"Welcome to Willie!\\nI can't seem to find the configuration file, so let's generate it!\\n\")\n            if not configpath.endswith('.cfg'):\n                configpath = configpath + '.cfg'\n            create_config(configpath)\n            configpath = find_config(config_name)\n        try:\n            config_module = Config(configpath)\n        except ConfigurationError as e:\n            stderr(e)\n            sys.exit(2)\n\n        if config_module.core.not_configured:\n            stderr('Bot is not configured, can\\'t start')\n            # exit with code 2 to prevent auto restart on fail by systemd\n            sys.exit(2)\n\n        if not config_module.has_option('core', 'homedir'):\n            config_module.dotdir = homedir\n            config_module.homedir = homedir\n        else:\n            homedir = config_module.core.homedir\n            config_module.dotdir = config_module.core.homedir\n\n        if not config_module.core.logdir:\n            config_module.core.logdir = os.path.join(homedir, 'logs')\n        logfile = os.path.os.path.join(config_module.logdir, 'stdio.log')\n        if not os.path.isdir(config_module.logdir):\n            os.mkdir(config_module.logdir)\n\n        config_module.exit_on_error = opts.exit_on_error\n\n        sys.stderr = tools.OutputRedirect(logfile, True, opts.quiet)\n        sys.stdout = tools.OutputRedirect(logfile, False, opts.quiet)\n\n        #Handle --quit, --kill and saving the PID to file\n        pid_dir = config_module.core.pid_dir or homedir\n        if opts.config is None:\n            pid_file_path = os.path.join(pid_dir, 'willie.pid')\n        else:\n            basename = os.path.basename(opts.config)\n            if basename.endswith('.cfg'):\n                basename = basename[:-4]\n            pid_file_path = os.path.join(pid_dir, 'willie-%s.pid' % basename)\n        if os.path.isfile(pid_file_path):\n            pid_file = open(pid_file_path, 'r')\n            old_pid = int(pid_file.read())\n            pid_file.close()\n            if tools.check_pid(old_pid):\n                if not opts.quit and not opts.kill:\n                    stderr('There\\'s already a Willie instance running with this config file')\n                    stderr('Try using the --quit or the --kill options')\n                    sys.exit(1)\n                elif opts.kill:\n                    stderr('Killing the willie')\n                    os.kill(old_pid, signal.SIGKILL)\n                    sys.exit(0)\n                elif opts.quit:\n                    stderr('Signaling Willie to stop gracefully')\n                    if hasattr(signal, 'SIGUSR1'):\n                        os.kill(old_pid, signal.SIGUSR1)\n                    else:\n                        os.kill(old_pid, signal.SIGTERM)\n                    sys.exit(0)\n            elif not tools.check_pid(old_pid) and (opts.kill or opts.quit):\n                stderr('Willie is not running!')\n                sys.exit(1)\n        elif opts.quit or opts.kill:\n            stderr('Willie is not running!')\n            sys.exit(1)\n        if opts.deamonize:\n            child_pid = os.fork()\n            if child_pid is not 0:\n                sys.exit()\n        pid_file = open(pid_file_path, 'w')\n        pid_file.write(str(os.getpid()))\n        pid_file.close()\n        config_module.pid_file_path = pid_file_path\n\n        # Step Five: Initialise And Run willie\n        run(config_module)\n    except KeyboardInterrupt:\n        print(\"\\n\\nInterrupted\")\n        os._exit(1)\nif __name__ == '__main__':\n    main()\n", "path": "willie.py"}]}