prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Enforce the minimal coverage to 100%
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `cookiecutter/utils.py`
  Content:
  ```
  1 """Helper functions used throughout Cookiecutter."""
  2 import contextlib
  3 import errno
  4 import logging
  5 import os
  6 import shutil
  7 import stat
  8 import sys
  9 
  10 from cookiecutter.prompt import read_user_yes_no
  11 
  12 logger = logging.getLogger(__name__)
  13 
  14 
  15 def force_delete(func, path, exc_info):
  16     """Error handler for `shutil.rmtree()` equivalent to `rm -rf`.
  17 
  18     Usage: `shutil.rmtree(path, onerror=force_delete)`
  19     From stackoverflow.com/questions/1889597
  20     """
  21     os.chmod(path, stat.S_IWRITE)
  22     func(path)
  23 
  24 
  25 def rmtree(path):
  26     """Remove a directory and all its contents. Like rm -rf on Unix.
  27 
  28     :param path: A directory path.
  29     """
  30     shutil.rmtree(path, onerror=force_delete)
  31 
  32 
  33 def make_sure_path_exists(path):
  34     """Ensure that a directory exists.
  35 
  36     :param path: A directory path.
  37     """
  38     logger.debug('Making sure path exists: %s', path)
  39     try:
  40         os.makedirs(path)
  41         logger.debug('Created directory at: %s', path)
  42     except OSError as exception:
  43         if exception.errno != errno.EEXIST:
  44             return False
  45     return True
  46 
  47 
  48 @contextlib.contextmanager
  49 def work_in(dirname=None):
  50     """Context manager version of os.chdir.
  51 
  52     When exited, returns to the working directory prior to entering.
  53     """
  54     curdir = os.getcwd()
  55     try:
  56         if dirname is not None:
  57             os.chdir(dirname)
  58         yield
  59     finally:
  60         os.chdir(curdir)
  61 
  62 
  63 def make_executable(script_path):
  64     """Make `script_path` executable.
  65 
  66     :param script_path: The file to change
  67     """
  68     status = os.stat(script_path)
  69     os.chmod(script_path, status.st_mode | stat.S_IEXEC)
  70 
  71 
  72 def prompt_and_delete(path, no_input=False):
  73     """
  74     Ask user if it's okay to delete the previously-downloaded file/directory.
  75 
  76     If yes, delete it. If no, checks to see if the old version should be
  77     reused. If yes, it's reused; otherwise, Cookiecutter exits.
  78 
  79     :param path: Previously downloaded zipfile.
  80     :param no_input: Suppress prompt to delete repo and just delete it.
  81     :return: True if the content was deleted
  82     """
  83     # Suppress prompt if called via API
  84     if no_input:
  85         ok_to_delete = True
  86     else:
  87         question = (
  88             "You've downloaded {} before. Is it okay to delete and re-download it?"
  89         ).format(path)
  90 
  91         ok_to_delete = read_user_yes_no(question, 'yes')
  92 
  93     if ok_to_delete:
  94         if os.path.isdir(path):
  95             rmtree(path)
  96         else:
  97             os.remove(path)
  98         return True
  99     else:
  100         ok_to_reuse = read_user_yes_no(
  101             "Do you want to re-use the existing version?", 'yes'
  102         )
  103 
  104         if ok_to_reuse:
  105             return False
  106 
  107         sys.exit()
  108
  ```
  --- 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/cookiecutter/utils.py b/cookiecutter/utils.py
  --- a/cookiecutter/utils.py
  +++ b/cookiecutter/utils.py
  @@ -16,7 +16,7 @@
       """Error handler for `shutil.rmtree()` equivalent to `rm -rf`.
   
       Usage: `shutil.rmtree(path, onerror=force_delete)`
  -    From stackoverflow.com/questions/1889597
  +    From https://docs.python.org/3/library/shutil.html#rmtree-example
       """
       os.chmod(path, stat.S_IWRITE)
       func(path)
  
verification_info: {"golden_diff": "diff --git a/cookiecutter/utils.py b/cookiecutter/utils.py\n--- a/cookiecutter/utils.py\n+++ b/cookiecutter/utils.py\n@@ -16,7 +16,7 @@\n     \"\"\"Error handler for `shutil.rmtree()` equivalent to `rm -rf`.\n \n     Usage: `shutil.rmtree(path, onerror=force_delete)`\n-    From stackoverflow.com/questions/1889597\n+    From https://docs.python.org/3/library/shutil.html#rmtree-example\n     \"\"\"\n     os.chmod(path, stat.S_IWRITE)\n     func(path)\n", "issue": "Enforce the minimal coverage to 100%\n\n", "before_files": [{"content": "\"\"\"Helper functions used throughout Cookiecutter.\"\"\"\nimport contextlib\nimport errno\nimport logging\nimport os\nimport shutil\nimport stat\nimport sys\n\nfrom cookiecutter.prompt import read_user_yes_no\n\nlogger = logging.getLogger(__name__)\n\n\ndef force_delete(func, path, exc_info):\n    \"\"\"Error handler for `shutil.rmtree()` equivalent to `rm -rf`.\n\n    Usage: `shutil.rmtree(path, onerror=force_delete)`\n    From stackoverflow.com/questions/1889597\n    \"\"\"\n    os.chmod(path, stat.S_IWRITE)\n    func(path)\n\n\ndef rmtree(path):\n    \"\"\"Remove a directory and all its contents. Like rm -rf on Unix.\n\n    :param path: A directory path.\n    \"\"\"\n    shutil.rmtree(path, onerror=force_delete)\n\n\ndef make_sure_path_exists(path):\n    \"\"\"Ensure that a directory exists.\n\n    :param path: A directory path.\n    \"\"\"\n    logger.debug('Making sure path exists: %s', path)\n    try:\n        os.makedirs(path)\n        logger.debug('Created directory at: %s', path)\n    except OSError as exception:\n        if exception.errno != errno.EEXIST:\n            return False\n    return True\n\n\n@contextlib.contextmanager\ndef work_in(dirname=None):\n    \"\"\"Context manager version of os.chdir.\n\n    When exited, returns to the working directory prior to entering.\n    \"\"\"\n    curdir = os.getcwd()\n    try:\n        if dirname is not None:\n            os.chdir(dirname)\n        yield\n    finally:\n        os.chdir(curdir)\n\n\ndef make_executable(script_path):\n    \"\"\"Make `script_path` executable.\n\n    :param script_path: The file to change\n    \"\"\"\n    status = os.stat(script_path)\n    os.chmod(script_path, status.st_mode | stat.S_IEXEC)\n\n\ndef prompt_and_delete(path, no_input=False):\n    \"\"\"\n    Ask user if it's okay to delete the previously-downloaded file/directory.\n\n    If yes, delete it. If no, checks to see if the old version should be\n    reused. If yes, it's reused; otherwise, Cookiecutter exits.\n\n    :param path: Previously downloaded zipfile.\n    :param no_input: Suppress prompt to delete repo and just delete it.\n    :return: True if the content was deleted\n    \"\"\"\n    # Suppress prompt if called via API\n    if no_input:\n        ok_to_delete = True\n    else:\n        question = (\n            \"You've downloaded {} before. Is it okay to delete and re-download it?\"\n        ).format(path)\n\n        ok_to_delete = read_user_yes_no(question, 'yes')\n\n    if ok_to_delete:\n        if os.path.isdir(path):\n            rmtree(path)\n        else:\n            os.remove(path)\n        return True\n    else:\n        ok_to_reuse = read_user_yes_no(\n            \"Do you want to re-use the existing version?\", 'yes'\n        )\n\n        if ok_to_reuse:\n            return False\n\n        sys.exit()\n", "path": "cookiecutter/utils.py"}], "after_files": [{"content": "\"\"\"Helper functions used throughout Cookiecutter.\"\"\"\nimport contextlib\nimport errno\nimport logging\nimport os\nimport shutil\nimport stat\nimport sys\n\nfrom cookiecutter.prompt import read_user_yes_no\n\nlogger = logging.getLogger(__name__)\n\n\ndef force_delete(func, path, exc_info):\n    \"\"\"Error handler for `shutil.rmtree()` equivalent to `rm -rf`.\n\n    Usage: `shutil.rmtree(path, onerror=force_delete)`\n    From https://docs.python.org/3/library/shutil.html#rmtree-example\n    \"\"\"\n    os.chmod(path, stat.S_IWRITE)\n    func(path)\n\n\ndef rmtree(path):\n    \"\"\"Remove a directory and all its contents. Like rm -rf on Unix.\n\n    :param path: A directory path.\n    \"\"\"\n    shutil.rmtree(path, onerror=force_delete)\n\n\ndef make_sure_path_exists(path):\n    \"\"\"Ensure that a directory exists.\n\n    :param path: A directory path.\n    \"\"\"\n    logger.debug('Making sure path exists: %s', path)\n    try:\n        os.makedirs(path)\n        logger.debug('Created directory at: %s', path)\n    except OSError as exception:\n        if exception.errno != errno.EEXIST:\n            return False\n    return True\n\n\n@contextlib.contextmanager\ndef work_in(dirname=None):\n    \"\"\"Context manager version of os.chdir.\n\n    When exited, returns to the working directory prior to entering.\n    \"\"\"\n    curdir = os.getcwd()\n    try:\n        if dirname is not None:\n            os.chdir(dirname)\n        yield\n    finally:\n        os.chdir(curdir)\n\n\ndef make_executable(script_path):\n    \"\"\"Make `script_path` executable.\n\n    :param script_path: The file to change\n    \"\"\"\n    status = os.stat(script_path)\n    os.chmod(script_path, status.st_mode | stat.S_IEXEC)\n\n\ndef prompt_and_delete(path, no_input=False):\n    \"\"\"\n    Ask user if it's okay to delete the previously-downloaded file/directory.\n\n    If yes, delete it. If no, checks to see if the old version should be\n    reused. If yes, it's reused; otherwise, Cookiecutter exits.\n\n    :param path: Previously downloaded zipfile.\n    :param no_input: Suppress prompt to delete repo and just delete it.\n    :return: True if the content was deleted\n    \"\"\"\n    # Suppress prompt if called via API\n    if no_input:\n        ok_to_delete = True\n    else:\n        question = (\n            \"You've downloaded {} before. Is it okay to delete and re-download it?\"\n        ).format(path)\n\n        ok_to_delete = read_user_yes_no(question, 'yes')\n\n    if ok_to_delete:\n        if os.path.isdir(path):\n            rmtree(path)\n        else:\n            os.remove(path)\n        return True\n    else:\n        ok_to_reuse = read_user_yes_no(\n            \"Do you want to re-use the existing version?\", 'yes'\n        )\n\n        if ok_to_reuse:\n            return False\n\n        sys.exit()\n", "path": "cookiecutter/utils.py"}]}