prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Download only fails for `gwdd`
  ```
  ethan@gandalf:~$ retriever download gwdd
  => Installing Zanne et al. Global wood density database.
  Creating database GWDD...
  Couldn't create database ('NoneType' object has no attribute 'execute'). Trying to continue anyway.
  'table_name'
  ```
  
  And the file doesn't appear.
  
  From `try_install_all.py`:
  
  ```
  ('download', 'gwdd', KeyError('table_name',))
  ```
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `scripts/gwdd.py`
  Content:
  ```
  1 #retriever
  2 """Retriever script for Zanne et al. Global wood density database.
  3 
  4 """
  5 from builtins import str
  6 from builtins import range
  7 
  8 import os
  9 import sys
  10 import xlrd
  11 from retriever.lib.templates import Script
  12 from retriever.lib.models import Table
  13 from retriever.lib.excel import Excel
  14 
  15 
  16 
  17 class main(Script):
  18     def __init__(self, **kwargs):
  19         Script.__init__(self, **kwargs)
  20         self.name = "Zanne et al. Global wood density database."
  21         self.shortname = "GWDD"
  22         self.retriever_minimum_version = '2.0.0-dev'
  23         self.script_version = '1.0'
  24         self.urls = {"GWDD": "http://datadryad.org/bitstream/handle/10255/dryad.235/GlobalWoodDensityDatabase.xls?sequence=1"}
  25         self.tags = ["Taxon > Plants", "Spatial Scale > Global",
  26                      "Data Type > Observational"]
  27         self.ref = "http://datadryad.org/resource/doi:10.5061/dryad.234"
  28         self.description = "A collection  and collation of data on the major wood functional traits, including the largest wood density database to date (8412 taxa), mechanical strength measures and anatomical features, as well as clade-specific features such as secondary chemistry."
  29         self.citation = "Chave J, Coomes DA, Jansen S, Lewis SL, Swenson NG, Zanne AE (2009) Towards a worldwide wood economics spectrum. Ecology Letters 12(4): 351-366. http://dx.doi.org/10.1111/j.1461-0248.2009.01285.x"
  30         self.addendum = """ *Correspondence for updates to the database: G.Lopez-Gonzalez@leeds.ac.uk
  31         For descriptions of the database, see Chave et al. 2009. Towards a worldwide wood economics spectrum. Ecology Letters. Identifier: http://hdl.handle.net/10255/dryad.234
  32 
  33         Below we list the rules of use for the Global wood density database. 
  34         These are developed based on the rules of use for the Glopnet dataset (www.nature.com/nature/journal/v428/n6985/full/nature02403.html) and Cedar Creek LTER and Related Data (http://www.lter.umn.edu/cgi-bin/register). 
  35         If you would like to use the Global wood density database, we request that you:
  36         1. Notify the main address of correspondence (Gaby Lopez-Gonzalo) if you plan to use the database in a publication.
  37         2. Provide recognition of the efforts of this group in the assembly of the data by using the citation for the database above.
  38         3. Recognize that these data were assembled by the group for various analyses and research questions. If any of these uses overlap with your interests, you recognize that group has precedence in addressing these questions."""
  39 
  40     def download(self, engine=None, debug=False):
  41         Script.download(self, engine, debug)
  42 
  43         self.engine.download_file(self.urls["GWDD"], "GlobalWoodDensityDatabase.xls")
  44         filename = os.path.basename("GlobalWoodDensityDatabase.xls")
  45 
  46         book = xlrd.open_workbook(self.engine.format_filename(filename))
  47         sh = book.sheet_by_index(1)
  48         rows = sh.nrows
  49 
  50         #Creating data table
  51         lines = []
  52         for i in range(1, rows):
  53             row = sh.row(i)
  54             if not all(Excel.empty_cell(cell) for cell in row):
  55                 this_line = {}
  56                 def format_value(s):
  57                     s = Excel.cell_value(s)
  58                     return str(s).title().replace("\\", "/").replace('"', '')
  59                 for num, label in enumerate(["Number", "Family", "Binomial", "Wood_Density",
  60                             "Region", "Reference_Number"]):
  61                     this_line[label] = format_value(row[num])
  62                 lines.append(this_line)
  63 
  64         table = Table("data", delimiter="\t")
  65         table.columns=[("Number"                ,   ("pk-int",) ),
  66                        ("Family"                ,   ("char",)   ),
  67                        ("Binomial"              ,   ("char",)   ),
  68                        ("Wood_Density"          ,   ("double",) ),
  69                        ("Region"                ,   ("char",)   ),
  70                        ("Reference_Number"      ,   ("int",)    )]
  71         table.pk = 'Number'
  72         table.contains_pk = True
  73 
  74         gwdd = []
  75         for line in lines:
  76             gwdd_data = [line["Number"],
  77                          line["Family"],
  78                          line["Binomial"],
  79                          line["Wood_Density"],
  80                          line["Region"],
  81                          line["Reference_Number"]]
  82             gwdd.append(gwdd_data)
  83 
  84         data = ['\t'.join(gwdd_line) for gwdd_line in gwdd]
  85         self.engine.table = table
  86         self.engine.create_table()
  87         self.engine.add_to_table(data)
  88 
  89         #Creating reference table
  90         lines = []
  91         sh = book.sheet_by_index(2)
  92         rows = sh.nrows
  93         for i in range(1, rows):
  94             row = sh.row(i)
  95             if not all(Excel.empty_cell(cell) for cell in row):
  96                 this_line = {}
  97                 def format_value(s):
  98                     s = Excel.cell_value(s)
  99                     return str(s).title().replace("\\", "/").replace('"', '')
  100                 for num, label in enumerate(["Reference_Number", "Reference"]):
  101                     this_line[label] = format_value(row[num])
  102                 lines.append(this_line)
  103 
  104         table = Table("reference", delimiter="\t")
  105         table.columns=[("Reference_Number"  ,   ("pk-int",) ),
  106                        ("Reference"         ,   ("char",)   )]
  107         table.pk = 'Reference_Number'
  108         table.contains_pk = True
  109 
  110         gwdd = []
  111         for line in lines:
  112             gwdd_ref = [line["Reference_Number"],
  113                         line["Reference"]]
  114             gwdd.append(gwdd_ref)
  115 
  116         data = ['\t'.join(gwdd_line) for gwdd_line in gwdd]
  117         self.engine.table = table
  118         self.engine.create_table()
  119         self.engine.add_to_table(data)
  120         
  121         return self.engine
  122 
  123 SCRIPT = main()
  124 
  125
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/scripts/gwdd.py b/scripts/gwdd.py
  --- a/scripts/gwdd.py
  +++ b/scripts/gwdd.py
  @@ -117,7 +117,8 @@
           self.engine.table = table
           self.engine.create_table()
           self.engine.add_to_table(data)
  -        
  +        self.engine.find_file("GlobalWoodDensityDatabase.xls")
  +
           return self.engine
   
   SCRIPT = main()
  
verification_info: {"golden_diff": "diff --git a/scripts/gwdd.py b/scripts/gwdd.py\n--- a/scripts/gwdd.py\n+++ b/scripts/gwdd.py\n@@ -117,7 +117,8 @@\n         self.engine.table = table\n         self.engine.create_table()\n         self.engine.add_to_table(data)\n-        \n+        self.engine.find_file(\"GlobalWoodDensityDatabase.xls\")\n+\n         return self.engine\n \n SCRIPT = main()\n", "issue": "Download only fails for `gwdd`\n```\nethan@gandalf:~$ retriever download gwdd\n=> Installing Zanne et al. Global wood density database.\nCreating database GWDD...\nCouldn't create database ('NoneType' object has no attribute 'execute'). Trying to continue anyway.\n'table_name'\n```\n\nAnd the file doesn't appear.\n\nFrom `try_install_all.py`:\n\n```\n('download', 'gwdd', KeyError('table_name',))\n```\n\n", "before_files": [{"content": "#retriever\n\"\"\"Retriever script for Zanne et al. Global wood density database.\n\n\"\"\"\nfrom builtins import str\nfrom builtins import range\n\nimport os\nimport sys\nimport xlrd\nfrom retriever.lib.templates import Script\nfrom retriever.lib.models import Table\nfrom retriever.lib.excel import Excel\n\n\n\nclass main(Script):\n    def __init__(self, **kwargs):\n        Script.__init__(self, **kwargs)\n        self.name = \"Zanne et al. Global wood density database.\"\n        self.shortname = \"GWDD\"\n        self.retriever_minimum_version = '2.0.0-dev'\n        self.script_version = '1.0'\n        self.urls = {\"GWDD\": \"http://datadryad.org/bitstream/handle/10255/dryad.235/GlobalWoodDensityDatabase.xls?sequence=1\"}\n        self.tags = [\"Taxon > Plants\", \"Spatial Scale > Global\",\n                     \"Data Type > Observational\"]\n        self.ref = \"http://datadryad.org/resource/doi:10.5061/dryad.234\"\n        self.description = \"A collection  and collation of data on the major wood functional traits, including the largest wood density database to date (8412 taxa), mechanical strength measures and anatomical features, as well as clade-specific features such as secondary chemistry.\"\n        self.citation = \"Chave J, Coomes DA, Jansen S, Lewis SL, Swenson NG, Zanne AE (2009) Towards a worldwide wood economics spectrum. Ecology Letters 12(4): 351-366. http://dx.doi.org/10.1111/j.1461-0248.2009.01285.x\"\n        self.addendum = \"\"\" *Correspondence for updates to the database: G.Lopez-Gonzalez@leeds.ac.uk\n        For descriptions of the database, see Chave et al. 2009. Towards a worldwide wood economics spectrum. Ecology Letters. Identifier: http://hdl.handle.net/10255/dryad.234\n\n        Below we list the rules of use for the Global wood density database. \n        These are developed based on the rules of use for the Glopnet dataset (www.nature.com/nature/journal/v428/n6985/full/nature02403.html) and Cedar Creek LTER and Related Data (http://www.lter.umn.edu/cgi-bin/register). \n        If you would like to use the Global wood density database, we request that you:\n        1. Notify the main address of correspondence (Gaby Lopez-Gonzalo) if you plan to use the database in a publication.\n        2. Provide recognition of the efforts of this group in the assembly of the data by using the citation for the database above.\n        3. Recognize that these data were assembled by the group for various analyses and research questions. If any of these uses overlap with your interests, you recognize that group has precedence in addressing these questions.\"\"\"\n\n    def download(self, engine=None, debug=False):\n        Script.download(self, engine, debug)\n\n        self.engine.download_file(self.urls[\"GWDD\"], \"GlobalWoodDensityDatabase.xls\")\n        filename = os.path.basename(\"GlobalWoodDensityDatabase.xls\")\n\n        book = xlrd.open_workbook(self.engine.format_filename(filename))\n        sh = book.sheet_by_index(1)\n        rows = sh.nrows\n\n        #Creating data table\n        lines = []\n        for i in range(1, rows):\n            row = sh.row(i)\n            if not all(Excel.empty_cell(cell) for cell in row):\n                this_line = {}\n                def format_value(s):\n                    s = Excel.cell_value(s)\n                    return str(s).title().replace(\"\\\\\", \"/\").replace('\"', '')\n                for num, label in enumerate([\"Number\", \"Family\", \"Binomial\", \"Wood_Density\",\n                            \"Region\", \"Reference_Number\"]):\n                    this_line[label] = format_value(row[num])\n                lines.append(this_line)\n\n        table = Table(\"data\", delimiter=\"\\t\")\n        table.columns=[(\"Number\"                ,   (\"pk-int\",) ),\n                       (\"Family\"                ,   (\"char\",)   ),\n                       (\"Binomial\"              ,   (\"char\",)   ),\n                       (\"Wood_Density\"          ,   (\"double\",) ),\n                       (\"Region\"                ,   (\"char\",)   ),\n                       (\"Reference_Number\"      ,   (\"int\",)    )]\n        table.pk = 'Number'\n        table.contains_pk = True\n\n        gwdd = []\n        for line in lines:\n            gwdd_data = [line[\"Number\"],\n                         line[\"Family\"],\n                         line[\"Binomial\"],\n                         line[\"Wood_Density\"],\n                         line[\"Region\"],\n                         line[\"Reference_Number\"]]\n            gwdd.append(gwdd_data)\n\n        data = ['\\t'.join(gwdd_line) for gwdd_line in gwdd]\n        self.engine.table = table\n        self.engine.create_table()\n        self.engine.add_to_table(data)\n\n        #Creating reference table\n        lines = []\n        sh = book.sheet_by_index(2)\n        rows = sh.nrows\n        for i in range(1, rows):\n            row = sh.row(i)\n            if not all(Excel.empty_cell(cell) for cell in row):\n                this_line = {}\n                def format_value(s):\n                    s = Excel.cell_value(s)\n                    return str(s).title().replace(\"\\\\\", \"/\").replace('\"', '')\n                for num, label in enumerate([\"Reference_Number\", \"Reference\"]):\n                    this_line[label] = format_value(row[num])\n                lines.append(this_line)\n\n        table = Table(\"reference\", delimiter=\"\\t\")\n        table.columns=[(\"Reference_Number\"  ,   (\"pk-int\",) ),\n                       (\"Reference\"         ,   (\"char\",)   )]\n        table.pk = 'Reference_Number'\n        table.contains_pk = True\n\n        gwdd = []\n        for line in lines:\n            gwdd_ref = [line[\"Reference_Number\"],\n                        line[\"Reference\"]]\n            gwdd.append(gwdd_ref)\n\n        data = ['\\t'.join(gwdd_line) for gwdd_line in gwdd]\n        self.engine.table = table\n        self.engine.create_table()\n        self.engine.add_to_table(data)\n        \n        return self.engine\n\nSCRIPT = main()\n\n", "path": "scripts/gwdd.py"}], "after_files": [{"content": "#retriever\n\"\"\"Retriever script for Zanne et al. Global wood density database.\n\n\"\"\"\nfrom builtins import str\nfrom builtins import range\n\nimport os\nimport sys\nimport xlrd\nfrom retriever.lib.templates import Script\nfrom retriever.lib.models import Table\nfrom retriever.lib.excel import Excel\n\n\n\nclass main(Script):\n    def __init__(self, **kwargs):\n        Script.__init__(self, **kwargs)\n        self.name = \"Zanne et al. Global wood density database.\"\n        self.shortname = \"GWDD\"\n        self.retriever_minimum_version = '2.0.0-dev'\n        self.script_version = '1.0'\n        self.urls = {\"GWDD\": \"http://datadryad.org/bitstream/handle/10255/dryad.235/GlobalWoodDensityDatabase.xls?sequence=1\"}\n        self.tags = [\"Taxon > Plants\", \"Spatial Scale > Global\",\n                     \"Data Type > Observational\"]\n        self.ref = \"http://datadryad.org/resource/doi:10.5061/dryad.234\"\n        self.description = \"A collection  and collation of data on the major wood functional traits, including the largest wood density database to date (8412 taxa), mechanical strength measures and anatomical features, as well as clade-specific features such as secondary chemistry.\"\n        self.citation = \"Chave J, Coomes DA, Jansen S, Lewis SL, Swenson NG, Zanne AE (2009) Towards a worldwide wood economics spectrum. Ecology Letters 12(4): 351-366. http://dx.doi.org/10.1111/j.1461-0248.2009.01285.x\"\n        self.addendum = \"\"\" *Correspondence for updates to the database: G.Lopez-Gonzalez@leeds.ac.uk\n        For descriptions of the database, see Chave et al. 2009. Towards a worldwide wood economics spectrum. Ecology Letters. Identifier: http://hdl.handle.net/10255/dryad.234\n\n        Below we list the rules of use for the Global wood density database. \n        These are developed based on the rules of use for the Glopnet dataset (www.nature.com/nature/journal/v428/n6985/full/nature02403.html) and Cedar Creek LTER and Related Data (http://www.lter.umn.edu/cgi-bin/register). \n        If you would like to use the Global wood density database, we request that you:\n        1. Notify the main address of correspondence (Gaby Lopez-Gonzalo) if you plan to use the database in a publication.\n        2. Provide recognition of the efforts of this group in the assembly of the data by using the citation for the database above.\n        3. Recognize that these data were assembled by the group for various analyses and research questions. If any of these uses overlap with your interests, you recognize that group has precedence in addressing these questions.\"\"\"\n\n    def download(self, engine=None, debug=False):\n        Script.download(self, engine, debug)\n\n        self.engine.download_file(self.urls[\"GWDD\"], \"GlobalWoodDensityDatabase.xls\")\n        filename = os.path.basename(\"GlobalWoodDensityDatabase.xls\")\n\n        book = xlrd.open_workbook(self.engine.format_filename(filename))\n        sh = book.sheet_by_index(1)\n        rows = sh.nrows\n\n        #Creating data table\n        lines = []\n        for i in range(1, rows):\n            row = sh.row(i)\n            if not all(Excel.empty_cell(cell) for cell in row):\n                this_line = {}\n                def format_value(s):\n                    s = Excel.cell_value(s)\n                    return str(s).title().replace(\"\\\\\", \"/\").replace('\"', '')\n                for num, label in enumerate([\"Number\", \"Family\", \"Binomial\", \"Wood_Density\",\n                            \"Region\", \"Reference_Number\"]):\n                    this_line[label] = format_value(row[num])\n                lines.append(this_line)\n\n        table = Table(\"data\", delimiter=\"\\t\")\n        table.columns=[(\"Number\"                ,   (\"pk-int\",) ),\n                       (\"Family\"                ,   (\"char\",)   ),\n                       (\"Binomial\"              ,   (\"char\",)   ),\n                       (\"Wood_Density\"          ,   (\"double\",) ),\n                       (\"Region\"                ,   (\"char\",)   ),\n                       (\"Reference_Number\"      ,   (\"int\",)    )]\n        table.pk = 'Number'\n        table.contains_pk = True\n\n        gwdd = []\n        for line in lines:\n            gwdd_data = [line[\"Number\"],\n                         line[\"Family\"],\n                         line[\"Binomial\"],\n                         line[\"Wood_Density\"],\n                         line[\"Region\"],\n                         line[\"Reference_Number\"]]\n            gwdd.append(gwdd_data)\n\n        data = ['\\t'.join(gwdd_line) for gwdd_line in gwdd]\n        self.engine.table = table\n        self.engine.create_table()\n        self.engine.add_to_table(data)\n\n        #Creating reference table\n        lines = []\n        sh = book.sheet_by_index(2)\n        rows = sh.nrows\n        for i in range(1, rows):\n            row = sh.row(i)\n            if not all(Excel.empty_cell(cell) for cell in row):\n                this_line = {}\n                def format_value(s):\n                    s = Excel.cell_value(s)\n                    return str(s).title().replace(\"\\\\\", \"/\").replace('\"', '')\n                for num, label in enumerate([\"Reference_Number\", \"Reference\"]):\n                    this_line[label] = format_value(row[num])\n                lines.append(this_line)\n\n        table = Table(\"reference\", delimiter=\"\\t\")\n        table.columns=[(\"Reference_Number\"  ,   (\"pk-int\",) ),\n                       (\"Reference\"         ,   (\"char\",)   )]\n        table.pk = 'Reference_Number'\n        table.contains_pk = True\n\n        gwdd = []\n        for line in lines:\n            gwdd_ref = [line[\"Reference_Number\"],\n                        line[\"Reference\"]]\n            gwdd.append(gwdd_ref)\n\n        data = ['\\t'.join(gwdd_line) for gwdd_line in gwdd]\n        self.engine.table = table\n        self.engine.create_table()\n        self.engine.add_to_table(data)\n        self.engine.find_file(\"GlobalWoodDensityDatabase.xls\")\n\n        return self.engine\n\nSCRIPT = main()\n\n", "path": "scripts/gwdd.py"}]}