prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  prompt.read_user_dict() is broken due to click upgrade from 7.1.2 to 8.0.0
  * Cookiecutter version: 1.7.3
  * Template project url: -
  * Python version: 3.9.5
  * Operating System: macOS Catalina 10.15.7
  
  ### Description:
  
  Apparently, there is a breaking change in `click==8.0.0` affecting dictionary values in cookiecutter.json
  cookiecutter.json example:
  ```json
  {
      "project_name": "",
      "project_policy": {"project_policy_example": "yes"}
  }
  ```
   
  ```
  % python -m cookiecutter ../Projects/project-configs
  devplatform_project_name [infra-dev]: 
  project_name []: t
  project_policy [default]: 
  Error: Unable to decode to JSON.
  ```
  
  Looking closer at the cookiecutter.promt, I can see that in `read_user_dict()`, click passes `user_value='default'` to `process_json()`, instead of passing an actual default value from the cookiecutter.json as it was in `click 7.1.2`. 
  Link to the `process_json()` code: https://github.com/cookiecutter/cookiecutter/blob/master/cookiecutter/prompt.py#L81
  ![image](https://user-images.githubusercontent.com/41152092/118825592-7a01bd80-b8c3-11eb-96fb-1f7bba264783.png)
  
  As far as I can suppose, that issue could have been introduced by this PR https://github.com/pallets/click/pull/1517/
  
  ### Quick local fix
  Install click first and specify version older than 8.0.0
  ```
  pip install click==7.1.2
  pip install cookiecutter
  ```
  
  ### Quick fix for cookiecutter library
  in `setup.py` replace 'click>=7.0' with `'click>=7,<8.0.0'`
  
  ### What I've run:
  
  ```shell
  % python3.9 -m venv test39              
    
  % source test39/bin/activate
  
  % python -V
  Python 3.9.5
  
  
  % python -m pip install click==7.1.2
  Collecting click==7.1.2
    Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
  Installing collected packages: click
  Successfully installed click-7.1.2
  (test39) ro.solyanik@macbook-ro Environments % python -m pip install cookiecutter
  Collecting cookiecutter
    Using cached cookiecutter-1.7.3-py2.py3-none-any.whl (34 kB)
  Collecting six>=1.10
  ................................................
  Installing collected packages: six, python-dateutil, MarkupSafe, urllib3, text-unidecode, Jinja2, idna, chardet, certifi, arrow, requests, python-slugify, poyo, jinja2-time, binaryornot, cookiecutter
  Successfully installed Jinja2-3.0.1 MarkupSafe-2.0.1 arrow-1.1.0 binaryornot-0.4.4 certifi-2020.12.5 chardet-4.0.0 cookiecutter-1.7.3 idna-2.10 jinja2-time-0.2.0 poyo-0.5.0 python-dateutil-2.8.1 python-slugify-5.0.2 requests-2.25.1 six-1.16.0 text-unidecode-1.3 urllib3-1.26.4
  
  % python -m cookiecutter ../Projects/project-configs
  project_name []: t
  project_policy [default]: 
  
  % ls t  
  Makefile        README.md       t               tests
  
  % rm -rf t
  
  % python -m pip install click==8.0.0                
  Collecting click==8.0.0
    Using cached click-8.0.0-py3-none-any.whl (96 kB)
  Installing collected packages: click
    Attempting uninstall: click
      Found existing installation: click 7.1.2
      Uninstalling click-7.1.2:
        Successfully uninstalled click-7.1.2
  Successfully installed click-8.0.0
  
  % python -m cookiecutter ../Projects/project-configs
  devplatform_project_name [infra-dev]: 
  project_name []: t
  project_policy [default]: 
  Error: Unable to decode to JSON.
  project_policy [default]: 
  Error: Unable to decode to JSON.
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `setup.py`
  Content:
  ```
  1 #!/usr/bin/env python
  2 """cookiecutter distutils configuration."""
  3 from setuptools import setup
  4 
  5 version = "2.0.0"
  6 
  7 with open('README.md', encoding='utf-8') as readme_file:
  8     readme = readme_file.read()
  9 
  10 requirements = [
  11     'binaryornot>=0.4.4',
  12     'Jinja2>=2.7,<4.0.0',
  13     'click>=7.0',
  14     'pyyaml>=5.3.1',
  15     'jinja2-time>=0.2.0',
  16     'python-slugify>=4.0.0',
  17     'requests>=2.23.0',
  18 ]
  19 
  20 setup(
  21     name='cookiecutter',
  22     version=version,
  23     description=(
  24         'A command-line utility that creates projects from project '
  25         'templates, e.g. creating a Python package project from a '
  26         'Python package project template.'
  27     ),
  28     long_description=readme,
  29     long_description_content_type='text/markdown',
  30     author='Audrey Feldroy',
  31     author_email='audreyr@gmail.com',
  32     url='https://github.com/cookiecutter/cookiecutter',
  33     packages=['cookiecutter'],
  34     package_dir={'cookiecutter': 'cookiecutter'},
  35     entry_points={'console_scripts': ['cookiecutter = cookiecutter.__main__:main']},
  36     include_package_data=True,
  37     python_requires='>=3.6',
  38     install_requires=requirements,
  39     license='BSD',
  40     zip_safe=False,
  41     classifiers=[
  42         "Development Status :: 5 - Production/Stable",
  43         "Environment :: Console",
  44         "Intended Audience :: Developers",
  45         "Natural Language :: English",
  46         "License :: OSI Approved :: BSD License",
  47         "Programming Language :: Python :: 3 :: Only",
  48         "Programming Language :: Python :: 3",
  49         "Programming Language :: Python :: 3.6",
  50         "Programming Language :: Python :: 3.7",
  51         "Programming Language :: Python :: 3.8",
  52         "Programming Language :: Python :: 3.9",
  53         "Programming Language :: Python :: Implementation :: CPython",
  54         "Programming Language :: Python :: Implementation :: PyPy",
  55         "Programming Language :: Python",
  56         "Topic :: Software Development",
  57     ],
  58     keywords=[
  59         "cookiecutter",
  60         "Python",
  61         "projects",
  62         "project templates",
  63         "Jinja2",
  64         "skeleton",
  65         "scaffolding",
  66         "project directory",
  67         "package",
  68         "packaging",
  69     ],
  70 )
  71
  ```
  --- 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/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -10,7 +10,7 @@
   requirements = [
       'binaryornot>=0.4.4',
       'Jinja2>=2.7,<4.0.0',
  -    'click>=7.0',
  +    'click>=7.0,<8.0.0',
       'pyyaml>=5.3.1',
       'jinja2-time>=0.2.0',
       'python-slugify>=4.0.0',
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -10,7 +10,7 @@\n requirements = [\n     'binaryornot>=0.4.4',\n     'Jinja2>=2.7,<4.0.0',\n-    'click>=7.0',\n+    'click>=7.0,<8.0.0',\n     'pyyaml>=5.3.1',\n     'jinja2-time>=0.2.0',\n     'python-slugify>=4.0.0',\n", "issue": "prompt.read_user_dict() is broken due to click upgrade from 7.1.2 to 8.0.0\n* Cookiecutter version: 1.7.3\r\n* Template project url: -\r\n* Python version: 3.9.5\r\n* Operating System: macOS Catalina 10.15.7\r\n\r\n### Description:\r\n\r\nApparently, there is a breaking change in `click==8.0.0` affecting dictionary values in cookiecutter.json\r\ncookiecutter.json example:\r\n```json\r\n{\r\n    \"project_name\": \"\",\r\n    \"project_policy\": {\"project_policy_example\": \"yes\"}\r\n}\r\n```\r\n \r\n```\r\n% python -m cookiecutter ../Projects/project-configs\r\ndevplatform_project_name [infra-dev]: \r\nproject_name []: t\r\nproject_policy [default]: \r\nError: Unable to decode to JSON.\r\n```\r\n\r\nLooking closer at the cookiecutter.promt, I can see that in `read_user_dict()`, click passes `user_value='default'` to `process_json()`, instead of passing an actual default value from the cookiecutter.json as it was in `click 7.1.2`. \r\nLink to the `process_json()` code: https://github.com/cookiecutter/cookiecutter/blob/master/cookiecutter/prompt.py#L81\r\n![image](https://user-images.githubusercontent.com/41152092/118825592-7a01bd80-b8c3-11eb-96fb-1f7bba264783.png)\r\n\r\nAs far as I can suppose, that issue could have been introduced by this PR https://github.com/pallets/click/pull/1517/\r\n\r\n### Quick local fix\r\nInstall click first and specify version older than 8.0.0\r\n```\r\npip install click==7.1.2\r\npip install cookiecutter\r\n```\r\n\r\n### Quick fix for cookiecutter library\r\nin `setup.py` replace 'click>=7.0' with `'click>=7,<8.0.0'`\r\n\r\n### What I've run:\r\n\r\n```shell\r\n% python3.9 -m venv test39              \r\n  \r\n% source test39/bin/activate\r\n\r\n% python -V\r\nPython 3.9.5\r\n\r\n\r\n% python -m pip install click==7.1.2\r\nCollecting click==7.1.2\r\n  Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)\r\nInstalling collected packages: click\r\nSuccessfully installed click-7.1.2\r\n(test39) ro.solyanik@macbook-ro Environments % python -m pip install cookiecutter\r\nCollecting cookiecutter\r\n  Using cached cookiecutter-1.7.3-py2.py3-none-any.whl (34 kB)\r\nCollecting six>=1.10\r\n................................................\r\nInstalling collected packages: six, python-dateutil, MarkupSafe, urllib3, text-unidecode, Jinja2, idna, chardet, certifi, arrow, requests, python-slugify, poyo, jinja2-time, binaryornot, cookiecutter\r\nSuccessfully installed Jinja2-3.0.1 MarkupSafe-2.0.1 arrow-1.1.0 binaryornot-0.4.4 certifi-2020.12.5 chardet-4.0.0 cookiecutter-1.7.3 idna-2.10 jinja2-time-0.2.0 poyo-0.5.0 python-dateutil-2.8.1 python-slugify-5.0.2 requests-2.25.1 six-1.16.0 text-unidecode-1.3 urllib3-1.26.4\r\n\r\n% python -m cookiecutter ../Projects/project-configs\r\nproject_name []: t\r\nproject_policy [default]: \r\n\r\n% ls t  \r\nMakefile        README.md       t               tests\r\n\r\n% rm -rf t\r\n\r\n% python -m pip install click==8.0.0                \r\nCollecting click==8.0.0\r\n  Using cached click-8.0.0-py3-none-any.whl (96 kB)\r\nInstalling collected packages: click\r\n  Attempting uninstall: click\r\n    Found existing installation: click 7.1.2\r\n    Uninstalling click-7.1.2:\r\n      Successfully uninstalled click-7.1.2\r\nSuccessfully installed click-8.0.0\r\n\r\n% python -m cookiecutter ../Projects/project-configs\r\ndevplatform_project_name [infra-dev]: \r\nproject_name []: t\r\nproject_policy [default]: \r\nError: Unable to decode to JSON.\r\nproject_policy [default]: \r\nError: Unable to decode to JSON.\r\n```\n", "before_files": [{"content": "#!/usr/bin/env python\n\"\"\"cookiecutter distutils configuration.\"\"\"\nfrom setuptools import setup\n\nversion = \"2.0.0\"\n\nwith open('README.md', encoding='utf-8') as readme_file:\n    readme = readme_file.read()\n\nrequirements = [\n    'binaryornot>=0.4.4',\n    'Jinja2>=2.7,<4.0.0',\n    'click>=7.0',\n    'pyyaml>=5.3.1',\n    'jinja2-time>=0.2.0',\n    'python-slugify>=4.0.0',\n    'requests>=2.23.0',\n]\n\nsetup(\n    name='cookiecutter',\n    version=version,\n    description=(\n        'A command-line utility that creates projects from project '\n        'templates, e.g. creating a Python package project from a '\n        'Python package project template.'\n    ),\n    long_description=readme,\n    long_description_content_type='text/markdown',\n    author='Audrey Feldroy',\n    author_email='audreyr@gmail.com',\n    url='https://github.com/cookiecutter/cookiecutter',\n    packages=['cookiecutter'],\n    package_dir={'cookiecutter': 'cookiecutter'},\n    entry_points={'console_scripts': ['cookiecutter = cookiecutter.__main__:main']},\n    include_package_data=True,\n    python_requires='>=3.6',\n    install_requires=requirements,\n    license='BSD',\n    zip_safe=False,\n    classifiers=[\n        \"Development Status :: 5 - Production/Stable\",\n        \"Environment :: Console\",\n        \"Intended Audience :: Developers\",\n        \"Natural Language :: English\",\n        \"License :: OSI Approved :: BSD License\",\n        \"Programming Language :: Python :: 3 :: Only\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: Implementation :: CPython\",\n        \"Programming Language :: Python :: Implementation :: PyPy\",\n        \"Programming Language :: Python\",\n        \"Topic :: Software Development\",\n    ],\n    keywords=[\n        \"cookiecutter\",\n        \"Python\",\n        \"projects\",\n        \"project templates\",\n        \"Jinja2\",\n        \"skeleton\",\n        \"scaffolding\",\n        \"project directory\",\n        \"package\",\n        \"packaging\",\n    ],\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\"\"\"cookiecutter distutils configuration.\"\"\"\nfrom setuptools import setup\n\nversion = \"2.0.0\"\n\nwith open('README.md', encoding='utf-8') as readme_file:\n    readme = readme_file.read()\n\nrequirements = [\n    'binaryornot>=0.4.4',\n    'Jinja2>=2.7,<4.0.0',\n    'click>=7.0,<8.0.0',\n    'pyyaml>=5.3.1',\n    'jinja2-time>=0.2.0',\n    'python-slugify>=4.0.0',\n    'requests>=2.23.0',\n]\n\nsetup(\n    name='cookiecutter',\n    version=version,\n    description=(\n        'A command-line utility that creates projects from project '\n        'templates, e.g. creating a Python package project from a '\n        'Python package project template.'\n    ),\n    long_description=readme,\n    long_description_content_type='text/markdown',\n    author='Audrey Feldroy',\n    author_email='audreyr@gmail.com',\n    url='https://github.com/cookiecutter/cookiecutter',\n    packages=['cookiecutter'],\n    package_dir={'cookiecutter': 'cookiecutter'},\n    entry_points={'console_scripts': ['cookiecutter = cookiecutter.__main__:main']},\n    include_package_data=True,\n    python_requires='>=3.6',\n    install_requires=requirements,\n    license='BSD',\n    zip_safe=False,\n    classifiers=[\n        \"Development Status :: 5 - Production/Stable\",\n        \"Environment :: Console\",\n        \"Intended Audience :: Developers\",\n        \"Natural Language :: English\",\n        \"License :: OSI Approved :: BSD License\",\n        \"Programming Language :: Python :: 3 :: Only\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: Implementation :: CPython\",\n        \"Programming Language :: Python :: Implementation :: PyPy\",\n        \"Programming Language :: Python\",\n        \"Topic :: Software Development\",\n    ],\n    keywords=[\n        \"cookiecutter\",\n        \"Python\",\n        \"projects\",\n        \"project templates\",\n        \"Jinja2\",\n        \"skeleton\",\n        \"scaffolding\",\n        \"project directory\",\n        \"package\",\n        \"packaging\",\n    ],\n)\n", "path": "setup.py"}]}