prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Fail to install and py.test on docker environment.
  <!-- Hello! If you're filing a bug, please include every step so as to help us reproduce it on our machines. If you're unsure about how to file an issue, use the issue template. If you need any help regarding usage of coala, check out the documentation or hit us up on chat. You can ignore or delete this text, it is commented and won't appear when the issue is submitted or previewed.
  
  Chat: https://coala.io/chat
  Issue Template: https://github.com/coala/coala/blob/master/CONTRIBUTING.rst#filing-issues
  Documentation: https://docs.coala.io
  -->
  When I try to install by `python setup.py install`, it is failed with this message.
  `UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 15224: ordinal not in range(128)`
  Also, the same happening when I try to run unit test on local.
  It needs to be fixed.
  
  
  --- 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 python3
  2 
  3 import datetime
  4 import locale
  5 import platform
  6 import sys
  7 from os import getenv
  8 from subprocess import call
  9 
  10 import setuptools.command.build_py
  11 from setuptools import find_packages, setup
  12 from setuptools.command.test import test as TestCommand
  13 
  14 from coalib import VERSION, assert_supported_version, get_version
  15 from coalib.misc.BuildManPage import BuildManPage
  16 
  17 try:
  18     locale.getlocale()
  19 except (ValueError, UnicodeError):
  20     locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
  21 
  22 
  23 assert_supported_version()
  24 
  25 
  26 class BuildPyCommand(setuptools.command.build_py.build_py):
  27 
  28     def run(self):
  29         if platform.system() != 'Windows':
  30             self.run_command('build_manpage')
  31         setuptools.command.build_py.build_py.run(self)
  32 
  33 
  34 class PyTestCommand(TestCommand):
  35 
  36     def run_tests(self):
  37         # import here, cause outside the eggs aren't loaded
  38         import pytest
  39         errno = pytest.main([])
  40         sys.exit(errno)
  41 
  42 
  43 class BuildDocsCommand(setuptools.command.build_py.build_py):
  44     apidoc_command = (
  45         'sphinx-apidoc', '-f', '-o', 'docs', '--no-toc', 'coalib'
  46     )
  47     doc_command = ('make', '-C', 'docs', 'html', 'SPHINXOPTS=-W')
  48 
  49     def run(self):
  50         errOne = call(self.apidoc_command)
  51         errTwo = call(self.doc_command)
  52         sys.exit(errOne or errTwo)
  53 
  54 
  55 # Generate API documentation only if we are running on readthedocs.io
  56 on_rtd = getenv('READTHEDOCS', None) is not None
  57 if on_rtd:
  58     call(BuildDocsCommand.apidoc_command)
  59     if 'dev' in VERSION:
  60         current_version = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
  61         call(['python3', '.misc/adjust_version_number.py', 'coalib/VERSION',
  62               '-b {}'.format(current_version)])
  63         VERSION = get_version()
  64 
  65 with open('requirements.txt') as requirements:
  66     required = requirements.read().splitlines()
  67 
  68 with open('test-requirements.txt') as requirements:
  69     test_required = requirements.read().splitlines()
  70 
  71 with open('README.rst') as readme:
  72     long_description = readme.read()
  73 
  74 
  75 if __name__ == '__main__':
  76     if platform.system() != 'Windows':
  77         data_files = [('.', ['coala.1'])]
  78     else:
  79         data_files = [('.', [])]
  80 
  81     setup(name='coala',
  82           version=VERSION,
  83           description='Linting and Fixing Code for All Languages',
  84           author='The coala developers',
  85           author_email='coala.analyzer@gmail.com',
  86           maintainer='Lasse Schuirmann, Fabian Neuschmidt, Mischa Kr\xfcger'
  87                      if not on_rtd else 'L.S., F.N., M.K.',
  88           maintainer_email=('lasse.schuirmann@gmail.com, '
  89                             'fabian@neuschmidt.de, '
  90                             'makman@alice.de'),
  91           url='http://coala.io/',
  92           platforms='any',
  93           packages=find_packages(exclude=['build.*', 'tests', 'tests.*']),
  94           install_requires=required,
  95           tests_require=test_required,
  96           package_data={'coalib': ['default_coafile', 'VERSION',
  97                                    'bearlib/languages/documentation/*.coalang']
  98                         },
  99           license='AGPL-3.0',
  100           data_files=data_files,
  101           long_description=long_description,
  102           entry_points={
  103               'console_scripts': [
  104                   'coala = coalib.coala:main',
  105                   'coala-ci = coalib.coala_ci:main',
  106                   'coala-json = coalib.coala_json:main',
  107                   'coala-format = coalib.coala_format:main',
  108                   'coala-delete-orig = coalib.coala_delete_orig:main']},
  109           # from http://pypi.python.org/pypi?%3Aaction=list_classifiers
  110           classifiers=[
  111               'Development Status :: 4 - Beta',
  112 
  113               'Environment :: Console',
  114               'Environment :: MacOS X',
  115               'Environment :: Win32 (MS Windows)',
  116               'Environment :: X11 Applications :: Gnome',
  117 
  118               'Intended Audience :: Science/Research',
  119               'Intended Audience :: Developers',
  120 
  121               'License :: OSI Approved :: GNU Affero General Public License '
  122               'v3 or later (AGPLv3+)',
  123 
  124               'Operating System :: OS Independent',
  125 
  126               'Programming Language :: Python :: Implementation :: CPython',
  127               'Programming Language :: Python :: 3.4',
  128               'Programming Language :: Python :: 3.5',
  129               'Programming Language :: Python :: 3 :: Only',
  130 
  131               'Topic :: Scientific/Engineering :: Information Analysis',
  132               'Topic :: Software Development :: Quality Assurance',
  133               'Topic :: Text Processing :: Linguistic'],
  134           cmdclass={'build_manpage': BuildManPage,
  135                     'build_py': BuildPyCommand,
  136                     'docs': BuildDocsCommand,
  137                     'test': PyTestCommand})
  138
  ```
  --- 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
  @@ -15,7 +15,10 @@
   from coalib.misc.BuildManPage import BuildManPage
   
   try:
  -    locale.getlocale()
  +    lc = locale.getlocale()
  +    pf = platform.system()
  +    if pf != 'Windows' and lc == (None, None):
  +        locale.setlocale(locale.LC_ALL, 'C.UTF-8')
   except (ValueError, UnicodeError):
       locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -15,7 +15,10 @@\n from coalib.misc.BuildManPage import BuildManPage\n \n try:\n-    locale.getlocale()\n+    lc = locale.getlocale()\n+    pf = platform.system()\n+    if pf != 'Windows' and lc == (None, None):\n+        locale.setlocale(locale.LC_ALL, 'C.UTF-8')\n except (ValueError, UnicodeError):\n     locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')\n", "issue": "Fail to install and py.test on docker environment.\n<!-- Hello! If you're filing a bug, please include every step so as to help us reproduce it on our machines. If you're unsure about how to file an issue, use the issue template. If you need any help regarding usage of coala, check out the documentation or hit us up on chat. You can ignore or delete this text, it is commented and won't appear when the issue is submitted or previewed.\r\n\r\nChat: https://coala.io/chat\r\nIssue Template: https://github.com/coala/coala/blob/master/CONTRIBUTING.rst#filing-issues\r\nDocumentation: https://docs.coala.io\r\n-->\r\nWhen I try to install by `python setup.py install`, it is failed with this message.\r\n`UnicodeEncodeError: 'ascii' codec can't encode character '\\xfc' in position 15224: ordinal not in range(128)`\r\nAlso, the same happening when I try to run unit test on local.\r\nIt needs to be fixed.\r\n\n", "before_files": [{"content": "#!/usr/bin/env python3\n\nimport datetime\nimport locale\nimport platform\nimport sys\nfrom os import getenv\nfrom subprocess import call\n\nimport setuptools.command.build_py\nfrom setuptools import find_packages, setup\nfrom setuptools.command.test import test as TestCommand\n\nfrom coalib import VERSION, assert_supported_version, get_version\nfrom coalib.misc.BuildManPage import BuildManPage\n\ntry:\n    locale.getlocale()\nexcept (ValueError, UnicodeError):\n    locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')\n\n\nassert_supported_version()\n\n\nclass BuildPyCommand(setuptools.command.build_py.build_py):\n\n    def run(self):\n        if platform.system() != 'Windows':\n            self.run_command('build_manpage')\n        setuptools.command.build_py.build_py.run(self)\n\n\nclass PyTestCommand(TestCommand):\n\n    def run_tests(self):\n        # import here, cause outside the eggs aren't loaded\n        import pytest\n        errno = pytest.main([])\n        sys.exit(errno)\n\n\nclass BuildDocsCommand(setuptools.command.build_py.build_py):\n    apidoc_command = (\n        'sphinx-apidoc', '-f', '-o', 'docs', '--no-toc', 'coalib'\n    )\n    doc_command = ('make', '-C', 'docs', 'html', 'SPHINXOPTS=-W')\n\n    def run(self):\n        errOne = call(self.apidoc_command)\n        errTwo = call(self.doc_command)\n        sys.exit(errOne or errTwo)\n\n\n# Generate API documentation only if we are running on readthedocs.io\non_rtd = getenv('READTHEDOCS', None) is not None\nif on_rtd:\n    call(BuildDocsCommand.apidoc_command)\n    if 'dev' in VERSION:\n        current_version = datetime.datetime.now().strftime('%Y%m%d%H%M%S')\n        call(['python3', '.misc/adjust_version_number.py', 'coalib/VERSION',\n              '-b {}'.format(current_version)])\n        VERSION = get_version()\n\nwith open('requirements.txt') as requirements:\n    required = requirements.read().splitlines()\n\nwith open('test-requirements.txt') as requirements:\n    test_required = requirements.read().splitlines()\n\nwith open('README.rst') as readme:\n    long_description = readme.read()\n\n\nif __name__ == '__main__':\n    if platform.system() != 'Windows':\n        data_files = [('.', ['coala.1'])]\n    else:\n        data_files = [('.', [])]\n\n    setup(name='coala',\n          version=VERSION,\n          description='Linting and Fixing Code for All Languages',\n          author='The coala developers',\n          author_email='coala.analyzer@gmail.com',\n          maintainer='Lasse Schuirmann, Fabian Neuschmidt, Mischa Kr\\xfcger'\n                     if not on_rtd else 'L.S., F.N., M.K.',\n          maintainer_email=('lasse.schuirmann@gmail.com, '\n                            'fabian@neuschmidt.de, '\n                            'makman@alice.de'),\n          url='http://coala.io/',\n          platforms='any',\n          packages=find_packages(exclude=['build.*', 'tests', 'tests.*']),\n          install_requires=required,\n          tests_require=test_required,\n          package_data={'coalib': ['default_coafile', 'VERSION',\n                                   'bearlib/languages/documentation/*.coalang']\n                        },\n          license='AGPL-3.0',\n          data_files=data_files,\n          long_description=long_description,\n          entry_points={\n              'console_scripts': [\n                  'coala = coalib.coala:main',\n                  'coala-ci = coalib.coala_ci:main',\n                  'coala-json = coalib.coala_json:main',\n                  'coala-format = coalib.coala_format:main',\n                  'coala-delete-orig = coalib.coala_delete_orig:main']},\n          # from http://pypi.python.org/pypi?%3Aaction=list_classifiers\n          classifiers=[\n              'Development Status :: 4 - Beta',\n\n              'Environment :: Console',\n              'Environment :: MacOS X',\n              'Environment :: Win32 (MS Windows)',\n              'Environment :: X11 Applications :: Gnome',\n\n              'Intended Audience :: Science/Research',\n              'Intended Audience :: Developers',\n\n              'License :: OSI Approved :: GNU Affero General Public License '\n              'v3 or later (AGPLv3+)',\n\n              'Operating System :: OS Independent',\n\n              'Programming Language :: Python :: Implementation :: CPython',\n              'Programming Language :: Python :: 3.4',\n              'Programming Language :: Python :: 3.5',\n              'Programming Language :: Python :: 3 :: Only',\n\n              'Topic :: Scientific/Engineering :: Information Analysis',\n              'Topic :: Software Development :: Quality Assurance',\n              'Topic :: Text Processing :: Linguistic'],\n          cmdclass={'build_manpage': BuildManPage,\n                    'build_py': BuildPyCommand,\n                    'docs': BuildDocsCommand,\n                    'test': PyTestCommand})\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python3\n\nimport datetime\nimport locale\nimport platform\nimport sys\nfrom os import getenv\nfrom subprocess import call\n\nimport setuptools.command.build_py\nfrom setuptools import find_packages, setup\nfrom setuptools.command.test import test as TestCommand\n\nfrom coalib import VERSION, assert_supported_version, get_version\nfrom coalib.misc.BuildManPage import BuildManPage\n\ntry:\n    lc = locale.getlocale()\n    pf = platform.system()\n    if pf != 'Windows' and lc == (None, None):\n        locale.setlocale(locale.LC_ALL, 'C.UTF-8')\nexcept (ValueError, UnicodeError):\n    locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')\n\n\nassert_supported_version()\n\n\nclass BuildPyCommand(setuptools.command.build_py.build_py):\n\n    def run(self):\n        if platform.system() != 'Windows':\n            self.run_command('build_manpage')\n        setuptools.command.build_py.build_py.run(self)\n\n\nclass PyTestCommand(TestCommand):\n\n    def run_tests(self):\n        # import here, cause outside the eggs aren't loaded\n        import pytest\n        errno = pytest.main([])\n        sys.exit(errno)\n\n\nclass BuildDocsCommand(setuptools.command.build_py.build_py):\n    apidoc_command = (\n        'sphinx-apidoc', '-f', '-o', 'docs', '--no-toc', 'coalib'\n    )\n    doc_command = ('make', '-C', 'docs', 'html', 'SPHINXOPTS=-W')\n\n    def run(self):\n        errOne = call(self.apidoc_command)\n        errTwo = call(self.doc_command)\n        sys.exit(errOne or errTwo)\n\n\n# Generate API documentation only if we are running on readthedocs.io\non_rtd = getenv('READTHEDOCS', None) is not None\nif on_rtd:\n    call(BuildDocsCommand.apidoc_command)\n    if 'dev' in VERSION:\n        current_version = datetime.datetime.now().strftime('%Y%m%d%H%M%S')\n        call(['python3', '.misc/adjust_version_number.py', 'coalib/VERSION',\n              '-b {}'.format(current_version)])\n        VERSION = get_version()\n\nwith open('requirements.txt') as requirements:\n    required = requirements.read().splitlines()\n\nwith open('test-requirements.txt') as requirements:\n    test_required = requirements.read().splitlines()\n\nwith open('README.rst') as readme:\n    long_description = readme.read()\n\n\nif __name__ == '__main__':\n    if platform.system() != 'Windows':\n        data_files = [('.', ['coala.1'])]\n    else:\n        data_files = [('.', [])]\n\n    setup(name='coala',\n          version=VERSION,\n          description='Linting and Fixing Code for All Languages',\n          author='The coala developers',\n          author_email='coala.analyzer@gmail.com',\n          maintainer='Lasse Schuirmann, Fabian Neuschmidt, Mischa Kr\\xfcger'\n                     if not on_rtd else 'L.S., F.N., M.K.',\n          maintainer_email=('lasse.schuirmann@gmail.com, '\n                            'fabian@neuschmidt.de, '\n                            'makman@alice.de'),\n          url='http://coala.io/',\n          platforms='any',\n          packages=find_packages(exclude=['build.*', 'tests', 'tests.*']),\n          install_requires=required,\n          tests_require=test_required,\n          package_data={'coalib': ['default_coafile', 'VERSION',\n                                   'bearlib/languages/documentation/*.coalang']\n                        },\n          license='AGPL-3.0',\n          data_files=data_files,\n          long_description=long_description,\n          entry_points={\n              'console_scripts': [\n                  'coala = coalib.coala:main',\n                  'coala-ci = coalib.coala_ci:main',\n                  'coala-json = coalib.coala_json:main',\n                  'coala-format = coalib.coala_format:main',\n                  'coala-delete-orig = coalib.coala_delete_orig:main']},\n          # from http://pypi.python.org/pypi?%3Aaction=list_classifiers\n          classifiers=[\n              'Development Status :: 4 - Beta',\n\n              'Environment :: Console',\n              'Environment :: MacOS X',\n              'Environment :: Win32 (MS Windows)',\n              'Environment :: X11 Applications :: Gnome',\n\n              'Intended Audience :: Science/Research',\n              'Intended Audience :: Developers',\n\n              'License :: OSI Approved :: GNU Affero General Public License '\n              'v3 or later (AGPLv3+)',\n\n              'Operating System :: OS Independent',\n\n              'Programming Language :: Python :: Implementation :: CPython',\n              'Programming Language :: Python :: 3.4',\n              'Programming Language :: Python :: 3.5',\n              'Programming Language :: Python :: 3 :: Only',\n\n              'Topic :: Scientific/Engineering :: Information Analysis',\n              'Topic :: Software Development :: Quality Assurance',\n              'Topic :: Text Processing :: Linguistic'],\n          cmdclass={'build_manpage': BuildManPage,\n                    'build_py': BuildPyCommand,\n                    'docs': BuildDocsCommand,\n                    'test': PyTestCommand})\n", "path": "setup.py"}]}