We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
give better error when DATABASE_URL is empty
@jamieforrest hit this and I just did as well. Here's the gnarly Traceback we currently have:

```
pid-39707 thread-140735224484224 (MainThread) Oh no! Aspen crashed!
pid-39707 thread-140735224484224 (MainThread) Traceback (most recent call last):
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/aspen/server.py", line 125, in main
pid-39707 thread-140735224484224 (MainThread)     _main(argv)
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/aspen/server.py", line 51, in _main
pid-39707 thread-140735224484224 (MainThread)     website = Website(argv)
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/aspen/website.py", line 31, in __init__
pid-39707 thread-140735224484224 (MainThread)     self.configure(argv)
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/aspen/configuration/__init__.py", line 343, in configure
pid-39707 thread-140735224484224 (MainThread)     self.run_config_scripts()
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/aspen/configuration/__init__.py", line 386, in run_config_scripts
pid-39707 thread-140735224484224 (MainThread)     execfile(filepath, {'website': self})
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/configure-aspen.py", line 7, in <module>
pid-39707 thread-140735224484224 (MainThread)     import gittip.authentication
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/gittip/authentication.py", line 10, in <module>
pid-39707 thread-140735224484224 (MainThread)     from gittip.orm import db
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/gittip/orm/__init__.py", line 73, in <module>
pid-39707 thread-140735224484224 (MainThread)     db = SQLAlchemy()
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/gittip/orm/__init__.py", line 31, in __init__
pid-39707 thread-140735224484224 (MainThread)     self.session = self.create_session()
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/gittip/orm/__init__.py", line 46, in create_session
pid-39707 thread-140735224484224 (MainThread)     session.configure(bind=self.engine)
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/gittip/orm/__init__.py", line 38, in engine
pid-39707 thread-140735224484224 (MainThread)     return create_engine(dburl, pool_size=maxconn, max_overflow=0)
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/sqlalchemy/engine/__init__.py", line 331, in create_engine
pid-39707 thread-140735224484224 (MainThread)     return strategy.create(*args, **kwargs)
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 48, in create
pid-39707 thread-140735224484224 (MainThread)     u = url.make_url(name_or_url)
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/sqlalchemy/engine/url.py", line 154, in make_url
pid-39707 thread-140735224484224 (MainThread)     return _parse_rfc1738_args(name_or_url)
pid-39707 thread-140735224484224 (MainThread)   File "/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/sqlalchemy/engine/url.py", line 196, in _parse_rfc1738_args
pid-39707 thread-140735224484224 (MainThread)     "Could not parse rfc1738 URL from string '%s'" % name)
pid-39707 thread-140735224484224 (MainThread) ArgumentError: Could not parse rfc1738 URL from string ''
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `gittip/utils/swaddle.py`
Content:
```
1 """Run a command with an environment specified in a file.
2 """
3 import os
4 import sys
5 if sys.platform.startswith('win'):
6     import ctypes
7 
8 
9 def configure(envdef):
10     """Given a filepath or -, return a tuple of bytestrings.
11     """
12     if envdef == '-':               # Heroku-style
13 
14         # Heroku used to use =>, which was weird. Now they use :, and we may as
15         # well too, but I had already started using =, and now changing would
16         # break people's local.env.
17 
18         m = "[SWADDLE] reading environment from stdin."
19         print >> sys.stderr, m
20         fp = sys.stdin
21         splitter = ": "
22     elif not os.path.isfile(envdef):
23         m = "[SWADDLE] %s is not a file; environment unchanged." % envdef
24         print >> sys.stderr, m
25         envdef = ""
26     else:                           # Gittip-style
27         fp = open(envdef)
28         splitter = "="
29 
30     args = sys.argv[2:]
31     if not args:
32         m ="[SWADDLE] No command specified; exiting."
33         raise SystemExit(m)
34     if sys.platform == 'win32' and not os.path.isfile(args[0]):
35         # Try with an '.exe' extension on Windows if the command doesn't
36         # already have an extension.
37         if os.path.splitext(args[0])[-1] == '':
38             args[0] += '.exe'
39     if not os.path.isfile(args[0]):
40         m ="[SWADDLE] Command %s does not exist; exiting." % args[0]
41         raise SystemExit(m)
42 
43     if envdef:
44         for line in fp:
45             line = line.split('#')[0].strip()
46             if splitter not in line:
47                 m = "[SWADDLE] Skipping line: %s." % line
48                 print >> sys.stderr, m
49                 continue
50             key, val = line.split(splitter, 1)
51             if sys.platform.startswith('win'):
52                 ctypes.windll.kernel32.SetEnvironmentVariableA(key.strip(), val.strip())
53             else:
54                 os.environ[key.strip()] = val.strip()
55 
56     return args
57 
58 
59 def main():
60     if len(sys.argv) < 1:
61         m ="[SWADDLE] Usage: %s {definition.env} {command} {args}" % sys.argv[0]
62         raise SystemExit(m)
63     envdef = sys.argv[1]
64     args = configure(envdef)
65     os.execv(args[0], args)
66
```

Path: `setup.py`
Content:
```
1 import os
2 from setuptools import setup, find_packages
3 
4 
5 def get_version():
6     try:
7         return open(os.path.join('www', 'version.txt')).read().strip()
8     except OSError:
9         return 'n/a'
10 
11 
12 setup( name='gittip'
13      , version=get_version()
14      , packages=find_packages()
15      , entry_points = { 'console_scripts'
16                       : [ 'payday=gittip.cli:payday'
17                         , 'swaddle=gittip.utils.swaddle:main'
18                         , 'fake_data=gittip.utils.fake_data:main'
19                          ]
20                        }
21       )
22
```
--- 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/gittip/utils/swaddle.py b/gittip/utils/swaddle.py
deleted file mode 100644
--- a/gittip/utils/swaddle.py
+++ /dev/null
@@ -1,65 +0,0 @@
-"""Run a command with an environment specified in a file.
-"""
-import os
-import sys
-if sys.platform.startswith('win'):
-    import ctypes
-
-
-def configure(envdef):
-    """Given a filepath or -, return a tuple of bytestrings.
-    """
-    if envdef == '-':               # Heroku-style
-
-        # Heroku used to use =>, which was weird. Now they use :, and we may as
-        # well too, but I had already started using =, and now changing would
-        # break people's local.env.
-
-        m = "[SWADDLE] reading environment from stdin."
-        print >> sys.stderr, m
-        fp = sys.stdin
-        splitter = ": "
-    elif not os.path.isfile(envdef):
-        m = "[SWADDLE] %s is not a file; environment unchanged." % envdef
-        print >> sys.stderr, m
-        envdef = ""
-    else:                           # Gittip-style
-        fp = open(envdef)
-        splitter = "="
-
-    args = sys.argv[2:]
-    if not args:
-        m ="[SWADDLE] No command specified; exiting."
-        raise SystemExit(m)
-    if sys.platform == 'win32' and not os.path.isfile(args[0]):
-        # Try with an '.exe' extension on Windows if the command doesn't
-        # already have an extension.
-        if os.path.splitext(args[0])[-1] == '':
-            args[0] += '.exe'
-    if not os.path.isfile(args[0]):
-        m ="[SWADDLE] Command %s does not exist; exiting." % args[0]
-        raise SystemExit(m)
-
-    if envdef:
-        for line in fp:
-            line = line.split('#')[0].strip()
-            if splitter not in line:
-                m = "[SWADDLE] Skipping line: %s." % line
-                print >> sys.stderr, m
-                continue
-            key, val = line.split(splitter, 1)
-            if sys.platform.startswith('win'):
-                ctypes.windll.kernel32.SetEnvironmentVariableA(key.strip(), val.strip())
-            else:
-                os.environ[key.strip()] = val.strip()
-
-    return args
-
-
-def main():
-    if len(sys.argv) < 1:
-        m ="[SWADDLE] Usage: %s {definition.env} {command} {args}" % sys.argv[0]
-        raise SystemExit(m)
-    envdef = sys.argv[1]
-    args = configure(envdef)
-    os.execv(args[0], args)
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,6 @@
      , packages=find_packages()
      , entry_points = { 'console_scripts'
                       : [ 'payday=gittip.cli:payday'
-                        , 'swaddle=gittip.utils.swaddle:main'
                         , 'fake_data=gittip.utils.fake_data:main'
                          ]
                        }

{"golden_diff": "diff --git a/gittip/utils/swaddle.py b/gittip/utils/swaddle.py\ndeleted file mode 100644\n--- a/gittip/utils/swaddle.py\n+++ /dev/null\n@@ -1,65 +0,0 @@\n-\"\"\"Run a command with an environment specified in a file.\n-\"\"\"\n-import os\n-import sys\n-if sys.platform.startswith('win'):\n-    import ctypes\n-\n-\n-def configure(envdef):\n-    \"\"\"Given a filepath or -, return a tuple of bytestrings.\n-    \"\"\"\n-    if envdef == '-':               # Heroku-style\n-\n-        # Heroku used to use =>, which was weird. Now they use :, and we may as\n-        # well too, but I had already started using =, and now changing would\n-        # break people's local.env.\n-\n-        m = \"[SWADDLE] reading environment from stdin.\"\n-        print >> sys.stderr, m\n-        fp = sys.stdin\n-        splitter = \": \"\n-    elif not os.path.isfile(envdef):\n-        m = \"[SWADDLE] %s is not a file; environment unchanged.\" % envdef\n-        print >> sys.stderr, m\n-        envdef = \"\"\n-    else:                           # Gittip-style\n-        fp = open(envdef)\n-        splitter = \"=\"\n-\n-    args = sys.argv[2:]\n-    if not args:\n-        m =\"[SWADDLE] No command specified; exiting.\"\n-        raise SystemExit(m)\n-    if sys.platform == 'win32' and not os.path.isfile(args[0]):\n-        # Try with an '.exe' extension on Windows if the command doesn't\n-        # already have an extension.\n-        if os.path.splitext(args[0])[-1] == '':\n-            args[0] += '.exe'\n-    if not os.path.isfile(args[0]):\n-        m =\"[SWADDLE] Command %s does not exist; exiting.\" % args[0]\n-        raise SystemExit(m)\n-\n-    if envdef:\n-        for line in fp:\n-            line = line.split('#')[0].strip()\n-            if splitter not in line:\n-                m = \"[SWADDLE] Skipping line: %s.\" % line\n-                print >> sys.stderr, m\n-                continue\n-            key, val = line.split(splitter, 1)\n-            if sys.platform.startswith('win'):\n-                ctypes.windll.kernel32.SetEnvironmentVariableA(key.strip(), val.strip())\n-            else:\n-                os.environ[key.strip()] = val.strip()\n-\n-    return args\n-\n-\n-def main():\n-    if len(sys.argv) < 1:\n-        m =\"[SWADDLE] Usage: %s {definition.env} {command} {args}\" % sys.argv[0]\n-        raise SystemExit(m)\n-    envdef = sys.argv[1]\n-    args = configure(envdef)\n-    os.execv(args[0], args)\ndiff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -14,7 +14,6 @@\n      , packages=find_packages()\n      , entry_points = { 'console_scripts'\n                       : [ 'payday=gittip.cli:payday'\n-                        , 'swaddle=gittip.utils.swaddle:main'\n                         , 'fake_data=gittip.utils.fake_data:main'\n                          ]\n                        }\n", "issue": "give better error when DATABASE_URL is empty\n@jamieforrest hit this and I just did as well. Here's the gnarly Traceback we currently have:\n\n```\npid-39707 thread-140735224484224 (MainThread) Oh no! Aspen crashed!\npid-39707 thread-140735224484224 (MainThread) Traceback (most recent call last):\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/aspen/server.py\", line 125, in main\npid-39707 thread-140735224484224 (MainThread)     _main(argv)\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/aspen/server.py\", line 51, in _main\npid-39707 thread-140735224484224 (MainThread)     website = Website(argv)\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/aspen/website.py\", line 31, in __init__\npid-39707 thread-140735224484224 (MainThread)     self.configure(argv)\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/aspen/configuration/__init__.py\", line 343, in configure\npid-39707 thread-140735224484224 (MainThread)     self.run_config_scripts()\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/aspen/configuration/__init__.py\", line 386, in run_config_scripts\npid-39707 thread-140735224484224 (MainThread)     execfile(filepath, {'website': self})\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/configure-aspen.py\", line 7, in <module>\npid-39707 thread-140735224484224 (MainThread)     import gittip.authentication\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/gittip/authentication.py\", line 10, in <module>\npid-39707 thread-140735224484224 (MainThread)     from gittip.orm import db\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/gittip/orm/__init__.py\", line 73, in <module>\npid-39707 thread-140735224484224 (MainThread)     db = SQLAlchemy()\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/gittip/orm/__init__.py\", line 31, in __init__\npid-39707 thread-140735224484224 (MainThread)     self.session = self.create_session()\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/gittip/orm/__init__.py\", line 46, in create_session\npid-39707 thread-140735224484224 (MainThread)     session.configure(bind=self.engine)\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/gittip/orm/__init__.py\", line 38, in engine\npid-39707 thread-140735224484224 (MainThread)     return create_engine(dburl, pool_size=maxconn, max_overflow=0)\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/sqlalchemy/engine/__init__.py\", line 331, in create_engine\npid-39707 thread-140735224484224 (MainThread)     return strategy.create(*args, **kwargs)\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py\", line 48, in create\npid-39707 thread-140735224484224 (MainThread)     u = url.make_url(name_or_url)\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/sqlalchemy/engine/url.py\", line 154, in make_url\npid-39707 thread-140735224484224 (MainThread)     return _parse_rfc1738_args(name_or_url)\npid-39707 thread-140735224484224 (MainThread)   File \"/Users/whit537/personal/gittip/www.gittip.com/env/lib/python2.7/site-packages/sqlalchemy/engine/url.py\", line 196, in _parse_rfc1738_args\npid-39707 thread-140735224484224 (MainThread)     \"Could not parse rfc1738 URL from string '%s'\" % name)\npid-39707 thread-140735224484224 (MainThread) ArgumentError: Could not parse rfc1738 URL from string ''\n```\n\n", "before_files": [{"content": "\"\"\"Run a command with an environment specified in a file.\n\"\"\"\nimport os\nimport sys\nif sys.platform.startswith('win'):\n    import ctypes\n\n\ndef configure(envdef):\n    \"\"\"Given a filepath or -, return a tuple of bytestrings.\n    \"\"\"\n    if envdef == '-':               # Heroku-style\n\n        # Heroku used to use =>, which was weird. Now they use :, and we may as\n        # well too, but I had already started using =, and now changing would\n        # break people's local.env.\n\n        m = \"[SWADDLE] reading environment from stdin.\"\n        print >> sys.stderr, m\n        fp = sys.stdin\n        splitter = \": \"\n    elif not os.path.isfile(envdef):\n        m = \"[SWADDLE] %s is not a file; environment unchanged.\" % envdef\n        print >> sys.stderr, m\n        envdef = \"\"\n    else:                           # Gittip-style\n        fp = open(envdef)\n        splitter = \"=\"\n\n    args = sys.argv[2:]\n    if not args:\n        m =\"[SWADDLE] No command specified; exiting.\"\n        raise SystemExit(m)\n    if sys.platform == 'win32' and not os.path.isfile(args[0]):\n        # Try with an '.exe' extension on Windows if the command doesn't\n        # already have an extension.\n        if os.path.splitext(args[0])[-1] == '':\n            args[0] += '.exe'\n    if not os.path.isfile(args[0]):\n        m =\"[SWADDLE] Command %s does not exist; exiting.\" % args[0]\n        raise SystemExit(m)\n\n    if envdef:\n        for line in fp:\n            line = line.split('#')[0].strip()\n            if splitter not in line:\n                m = \"[SWADDLE] Skipping line: %s.\" % line\n                print >> sys.stderr, m\n                continue\n            key, val = line.split(splitter, 1)\n            if sys.platform.startswith('win'):\n                ctypes.windll.kernel32.SetEnvironmentVariableA(key.strip(), val.strip())\n            else:\n                os.environ[key.strip()] = val.strip()\n\n    return args\n\n\ndef main():\n    if len(sys.argv) < 1:\n        m =\"[SWADDLE] Usage: %s {definition.env} {command} {args}\" % sys.argv[0]\n        raise SystemExit(m)\n    envdef = sys.argv[1]\n    args = configure(envdef)\n    os.execv(args[0], args)\n", "path": "gittip/utils/swaddle.py"}, {"content": "import os\nfrom setuptools import setup, find_packages\n\n\ndef get_version():\n    try:\n        return open(os.path.join('www', 'version.txt')).read().strip()\n    except OSError:\n        return 'n/a'\n\n\nsetup( name='gittip'\n     , version=get_version()\n     , packages=find_packages()\n     , entry_points = { 'console_scripts'\n                      : [ 'payday=gittip.cli:payday'\n                        , 'swaddle=gittip.utils.swaddle:main'\n                        , 'fake_data=gittip.utils.fake_data:main'\n                         ]\n                       }\n      )\n", "path": "setup.py"}], "after_files": [{"content": null, "path": "gittip/utils/swaddle.py"}, {"content": "import os\nfrom setuptools import setup, find_packages\n\n\ndef get_version():\n    try:\n        return open(os.path.join('www', 'version.txt')).read().strip()\n    except OSError:\n        return 'n/a'\n\n\nsetup( name='gittip'\n     , version=get_version()\n     , packages=find_packages()\n     , entry_points = { 'console_scripts'\n                      : [ 'payday=gittip.cli:payday'\n                        , 'fake_data=gittip.utils.fake_data:main'\n                         ]\n                       }\n      )\n", "path": "setup.py"}]}