prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Travis test ignore first letter of filename for some reason
  I'll try and figure out why, thought about simply renaming every file in the travis script but that requires alot of work and overhead for little gain, it is certainly doable, you have to configure the git on the travis instance and make a new commit etc.
  Might as well have a cron job or something to it recursively and periodically over the entirety of the repo and make a single commit...
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `.travis.py`
  Content:
  ```
  1 import json
  2 import os
  3 import re
  4 import subprocess
  5 
  6 # Get a diff between master and current.
  7 try:
  8     commit_range = os.environ["TRAVIS_COMMIT_RANGE"]
  9     changed_files = subprocess.check_output(["git", "diff", "--name-only", commit_range])
  10 except KeyError:
  11     print("🔥 This should be run on Travis. Otherwise make sure TRAVIS_BRANCH is set.")
  12     exit(1)
  13 
  14 # Filter JSON files only.
  15 changed_files_json = []
  16 if changed_files:
  17     changed_files = changed_files.decode()
  18     for changed_file in changed_files.split('\n'):
  19         if re.search(r"\.json$", changed_file):
  20             changed_files_json.append(changed_file)
  21 
  22 
  23 # Iterate over list of changed JSON files.
  24 for changed_file_json in changed_files_json:
  25     print(f"Checking file {changed_file_json}...")
  26     there_was_an_error = False
  27 
  28     if not changed_file_json[0].isupper():
  29         there_was_an_error = True
  30         print("🔥 File name not capitalized.")
  31 
  32     try:
  33         with open(changed_file_json) as data_file:
  34             file_content = json.loads(data_file.read())
  35     except json.decoder.JSONDecodeError:
  36         there_was_an_error = True
  37         print("🔥 JSON could not be parsed.")
  38 
  39     if 'word' not in file_content:
  40         there_was_an_error = True
  41         print("🔥 Key 'word' not found.")
  42 
  43     if not file_content["word"]:
  44         there_was_an_error = True
  45         print("🔥 Value for 'word' appears to be empty.")
  46 
  47     if 'definitions' not in file_content:
  48         there_was_an_error = True
  49         print("🔥 Key 'definitions' not found.")
  50 
  51     if not file_content["definitions"]:
  52         there_was_an_error = True
  53         print("🔥 Value for 'definitions' appears to be empty.")
  54 
  55     if 'parts-of-speech' not in file_content:
  56         there_was_an_error = True
  57         print("🔥 Key 'parts-of-speech' not found.")
  58 
  59     if not file_content["parts-of-speech"]:
  60         there_was_an_error = True
  61         print("🔥 Value for 'parts-of-speech' appears to be empty.")
  62 
  63     if there_was_an_error:
  64         exit(1)
  65
  ```
  --- 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/.travis.py b/.travis.py
  --- a/.travis.py
  +++ b/.travis.py
  @@ -19,13 +19,13 @@
           if re.search(r"\.json$", changed_file):
               changed_files_json.append(changed_file)
   
  -
  + 
   # Iterate over list of changed JSON files.
   for changed_file_json in changed_files_json:
       print(f"Checking file {changed_file_json}...")
       there_was_an_error = False
   
  -    if not changed_file_json[0].isupper():
  +    if not os.path.basename(changed_file_json)[0].isupper():
           there_was_an_error = True
           print("🔥 File name not capitalized.")
  
verification_info: {"golden_diff": "diff --git a/.travis.py b/.travis.py\n--- a/.travis.py\n+++ b/.travis.py\n@@ -19,13 +19,13 @@\n         if re.search(r\"\\.json$\", changed_file):\n             changed_files_json.append(changed_file)\n \n-\n+ \n # Iterate over list of changed JSON files.\n for changed_file_json in changed_files_json:\n     print(f\"Checking file {changed_file_json}...\")\n     there_was_an_error = False\n \n-    if not changed_file_json[0].isupper():\n+    if not os.path.basename(changed_file_json)[0].isupper():\n         there_was_an_error = True\n         print(\"\ud83d\udd25 File name not capitalized.\")\n", "issue": "Travis test ignore first letter of filename for some reason\nI'll try and figure out why, thought about simply renaming every file in the travis script but that requires alot of work and overhead for little gain, it is certainly doable, you have to configure the git on the travis instance and make a new commit etc.\r\nMight as well have a cron job or something to it recursively and periodically over the entirety of the repo and make a single commit...\n", "before_files": [{"content": "import json\nimport os\nimport re\nimport subprocess\n\n# Get a diff between master and current.\ntry:\n    commit_range = os.environ[\"TRAVIS_COMMIT_RANGE\"]\n    changed_files = subprocess.check_output([\"git\", \"diff\", \"--name-only\", commit_range])\nexcept KeyError:\n    print(\"\ud83d\udd25 This should be run on Travis. Otherwise make sure TRAVIS_BRANCH is set.\")\n    exit(1)\n\n# Filter JSON files only.\nchanged_files_json = []\nif changed_files:\n    changed_files = changed_files.decode()\n    for changed_file in changed_files.split('\\n'):\n        if re.search(r\"\\.json$\", changed_file):\n            changed_files_json.append(changed_file)\n\n\n# Iterate over list of changed JSON files.\nfor changed_file_json in changed_files_json:\n    print(f\"Checking file {changed_file_json}...\")\n    there_was_an_error = False\n\n    if not changed_file_json[0].isupper():\n        there_was_an_error = True\n        print(\"\ud83d\udd25 File name not capitalized.\")\n\n    try:\n        with open(changed_file_json) as data_file:\n            file_content = json.loads(data_file.read())\n    except json.decoder.JSONDecodeError:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 JSON could not be parsed.\")\n\n    if 'word' not in file_content:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Key 'word' not found.\")\n\n    if not file_content[\"word\"]:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Value for 'word' appears to be empty.\")\n\n    if 'definitions' not in file_content:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Key 'definitions' not found.\")\n\n    if not file_content[\"definitions\"]:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Value for 'definitions' appears to be empty.\")\n\n    if 'parts-of-speech' not in file_content:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Key 'parts-of-speech' not found.\")\n\n    if not file_content[\"parts-of-speech\"]:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Value for 'parts-of-speech' appears to be empty.\")\n\n    if there_was_an_error:\n        exit(1)\n", "path": ".travis.py"}], "after_files": [{"content": "import json\nimport os\nimport re\nimport subprocess\n\n# Get a diff between master and current.\ntry:\n    commit_range = os.environ[\"TRAVIS_COMMIT_RANGE\"]\n    changed_files = subprocess.check_output([\"git\", \"diff\", \"--name-only\", commit_range])\nexcept KeyError:\n    print(\"\ud83d\udd25 This should be run on Travis. Otherwise make sure TRAVIS_BRANCH is set.\")\n    exit(1)\n\n# Filter JSON files only.\nchanged_files_json = []\nif changed_files:\n    changed_files = changed_files.decode()\n    for changed_file in changed_files.split('\\n'):\n        if re.search(r\"\\.json$\", changed_file):\n            changed_files_json.append(changed_file)\n\n \n# Iterate over list of changed JSON files.\nfor changed_file_json in changed_files_json:\n    print(f\"Checking file {changed_file_json}...\")\n    there_was_an_error = False\n\n    if not os.path.basename(changed_file_json)[0].isupper():\n        there_was_an_error = True\n        print(\"\ud83d\udd25 File name not capitalized.\")\n\n    try:\n        with open(changed_file_json) as data_file:\n            file_content = json.loads(data_file.read())\n    except json.decoder.JSONDecodeError:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 JSON could not be parsed.\")\n\n    if 'word' not in file_content:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Key 'word' not found.\")\n\n    if not file_content[\"word\"]:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Value for 'word' appears to be empty.\")\n\n    if 'definitions' not in file_content:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Key 'definitions' not found.\")\n\n    if not file_content[\"definitions\"]:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Value for 'definitions' appears to be empty.\")\n\n    if 'parts-of-speech' not in file_content:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Key 'parts-of-speech' not found.\")\n\n    if not file_content[\"parts-of-speech\"]:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Value for 'parts-of-speech' appears to be empty.\")\n\n    if there_was_an_error:\n        exit(1)\n", "path": ".travis.py"}]}