We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Drop Support for Python 2
I'd like to propose that future development on Data Cube Core stop supporting Python 2 after the beginning of February 2018.

We can continue to support Python 2 for bug fix releases of version 1.5.x, but beyond that it is an ongoing drain on the limited developer resources.

--- 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 
3 import versioneer
4 from setuptools import setup, find_packages
5 
6 tests_require = [
7     'compliance-checker',
8     'hypothesis',
9     'mock',
10     'objgraph',
11     'pycodestyle',
12     'pylint',
13     'pytest',
14     'pytest-cov',
15     'pytest-timeout',
16 ]
17 
18 extras_require = {
19     'performance': ['ciso8601', 'bottleneck'],
20     'interactive': ['matplotlib', 'fiona'],
21     'distributed': ['distributed', 'dask[distributed]'],
22     'analytics': ['scipy', 'pyparsing', 'numexpr'],
23     'doc': ['Sphinx', 'setuptools'],
24     'replicas': ['paramiko', 'sshtunnel', 'tqdm'],
25     'celery': ['celery>=4', 'redis'],
26     's3': ['boto3==1.4.3', 'SharedArray', 'pathos', 'zstandard'],
27     'test': tests_require,
28 }
29 # An 'all' option, following ipython naming conventions.
30 extras_require['all'] = sorted(set(sum(extras_require.values(), [])))
31 
32 setup(
33     name='datacube',
34     version=versioneer.get_version(),
35     cmdclass=versioneer.get_cmdclass(),
36 
37     url='https://github.com/opendatacube/datacube-core',
38     author='AGDC Collaboration',
39     maintainer='AGDC Collaboration',
40     maintainer_email='',
41     description='An analysis environment for satellite and other earth observation data',
42     long_description=open('README.rst').read(),
43     license='Apache License 2.0',
44     classifiers=[
45         "Development Status :: 4 - Beta",
46         "Intended Audience :: Developers",
47         "Intended Audience :: Science/Research",
48         "License :: OSI Approved :: Apache Software License",
49         "Natural Language :: English",
50         "Operating System :: MacOS :: MacOS X",
51         "Operating System :: POSIX",
52         "Operating System :: POSIX :: BSD",
53         "Operating System :: POSIX :: Linux",
54         "Operating System :: Microsoft :: Windows",
55         "Programming Language :: Python",
56         "Programming Language :: Python :: 2",
57         "Programming Language :: Python :: 2.7",
58         "Programming Language :: Python :: 3",
59         "Programming Language :: Python :: 3.5",
60         "Topic :: Scientific/Engineering :: GIS",
61         "Topic :: Scientific/Engineering :: Information Analysis",
62     ],
63 
64     packages=find_packages(
65         exclude=('tests', 'tests.*',
66                  'integration_tests', 'integration_tests.*')
67     ),
68     package_data={
69         '': ['*.yaml', '*/*.yaml'],
70     },
71     scripts=[
72         'datacube_apps/scripts/pbs_helpers.sh'
73     ],
74     setup_requires=[
75         'pytest-runner'
76     ],
77     install_requires=[
78         'affine',
79         'cachetools',
80         'click>=5.0',
81         'cloudpickle>=0.4',
82         'dask[array]',
83         'gdal>=1.9',
84         'jsonschema',
85         'netcdf4',
86         'numpy',
87         'pathlib;python_version<"3"',
88         'psycopg2',
89         'pypeg2',
90         'python-dateutil',
91         'pyyaml',
92         'rasterio>=0.9a10',  # required for zip reading, 0.9 gets around 1.0a ordering problems
93         'singledispatch',
94         'sqlalchemy',
95         'xarray>=0.9',  # >0.9 fixes most problems with `crs` attributes being lost
96     ],
97     extras_require=extras_require,
98     tests_require=tests_require,
99 
100     entry_points={
101         'console_scripts': [
102             'datacube = datacube.scripts.cli_app:cli',
103             'datacube-search = datacube.scripts.search_tool:cli',
104             'datacube-stacker = datacube_apps.stacker:main',
105             'datacube-worker = datacube.execution.worker:main',
106             'datacube-fixer = datacube_apps.stacker:fixer_main',
107             'datacube-ncml = datacube_apps.ncml:ncml_app',
108             'pixeldrill = datacube_apps.pixeldrill:main [interactive]',
109             'movie_generator = datacube_apps.movie_generator:main',
110             'datacube-simple-replica = datacube_apps.simple_replica:replicate [replicas]'
111         ],
112         'datacube.plugins.io.read': [
113             'netcdf = datacube.drivers.netcdf.driver:reader_driver_init',
114             's3aio = datacube.drivers.s3.driver:reader_driver_init',
115             's3aio_test = datacube.drivers.s3.driver:reader_test_driver_init'
116         ],
117         'datacube.plugins.io.write': [
118             'netcdf = datacube.drivers.netcdf.driver:writer_driver_init',
119             's3aio = datacube.drivers.s3.driver:writer_driver_init',
120             's3aio_test = datacube.drivers.s3.driver:writer_test_driver_init',
121         ],
122         'datacube.plugins.index': [
123             'default = datacube.index.index:index_driver_init',
124             's3aio_index = datacube.drivers.s3aio_index:index_driver_init',
125         ],
126     },
127 )
128
```
--- 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()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -33,6 +33,7 @@
     name='datacube',
     version=versioneer.get_version(),
     cmdclass=versioneer.get_cmdclass(),
+    python_requires='>3.5.2',
 
     url='https://github.com/opendatacube/datacube-core',
     author='AGDC Collaboration',
@@ -53,10 +54,9 @@
         "Operating System :: POSIX :: Linux",
         "Operating System :: Microsoft :: Windows",
         "Programming Language :: Python",
-        "Programming Language :: Python :: 2",
-        "Programming Language :: Python :: 2.7",
         "Programming Language :: Python :: 3",
         "Programming Language :: Python :: 3.5",
+        "Programming Language :: Python :: 3.6",
         "Topic :: Scientific/Engineering :: GIS",
         "Topic :: Scientific/Engineering :: Information Analysis",
     ],
@@ -84,7 +84,6 @@
         'jsonschema',
         'netcdf4',
         'numpy',
-        'pathlib;python_version<"3"',
         'psycopg2',
         'pypeg2',
         'python-dateutil',

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -33,6 +33,7 @@\n     name='datacube',\n     version=versioneer.get_version(),\n     cmdclass=versioneer.get_cmdclass(),\n+    python_requires='>3.5.2',\n \n     url='https://github.com/opendatacube/datacube-core',\n     author='AGDC Collaboration',\n@@ -53,10 +54,9 @@\n         \"Operating System :: POSIX :: Linux\",\n         \"Operating System :: Microsoft :: Windows\",\n         \"Programming Language :: Python\",\n-        \"Programming Language :: Python :: 2\",\n-        \"Programming Language :: Python :: 2.7\",\n         \"Programming Language :: Python :: 3\",\n         \"Programming Language :: Python :: 3.5\",\n+        \"Programming Language :: Python :: 3.6\",\n         \"Topic :: Scientific/Engineering :: GIS\",\n         \"Topic :: Scientific/Engineering :: Information Analysis\",\n     ],\n@@ -84,7 +84,6 @@\n         'jsonschema',\n         'netcdf4',\n         'numpy',\n-        'pathlib;python_version<\"3\"',\n         'psycopg2',\n         'pypeg2',\n         'python-dateutil',\n", "issue": "Drop Support for Python 2\nI'd like to propose that future development on Data Cube Core stop supporting Python 2 after the beginning of February 2018.\r\n\r\nWe can continue to support Python 2 for bug fix releases of version 1.5.x, but beyond that it is an ongoing drain on the limited developer resources.\n", "before_files": [{"content": "#!/usr/bin/env python\n\nimport versioneer\nfrom setuptools import setup, find_packages\n\ntests_require = [\n    'compliance-checker',\n    'hypothesis',\n    'mock',\n    'objgraph',\n    'pycodestyle',\n    'pylint',\n    'pytest',\n    'pytest-cov',\n    'pytest-timeout',\n]\n\nextras_require = {\n    'performance': ['ciso8601', 'bottleneck'],\n    'interactive': ['matplotlib', 'fiona'],\n    'distributed': ['distributed', 'dask[distributed]'],\n    'analytics': ['scipy', 'pyparsing', 'numexpr'],\n    'doc': ['Sphinx', 'setuptools'],\n    'replicas': ['paramiko', 'sshtunnel', 'tqdm'],\n    'celery': ['celery>=4', 'redis'],\n    's3': ['boto3==1.4.3', 'SharedArray', 'pathos', 'zstandard'],\n    'test': tests_require,\n}\n# An 'all' option, following ipython naming conventions.\nextras_require['all'] = sorted(set(sum(extras_require.values(), [])))\n\nsetup(\n    name='datacube',\n    version=versioneer.get_version(),\n    cmdclass=versioneer.get_cmdclass(),\n\n    url='https://github.com/opendatacube/datacube-core',\n    author='AGDC Collaboration',\n    maintainer='AGDC Collaboration',\n    maintainer_email='',\n    description='An analysis environment for satellite and other earth observation data',\n    long_description=open('README.rst').read(),\n    license='Apache License 2.0',\n    classifiers=[\n        \"Development Status :: 4 - Beta\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Natural Language :: English\",\n        \"Operating System :: MacOS :: MacOS X\",\n        \"Operating System :: POSIX\",\n        \"Operating System :: POSIX :: BSD\",\n        \"Operating System :: POSIX :: Linux\",\n        \"Operating System :: Microsoft :: Windows\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 2\",\n        \"Programming Language :: Python :: 2.7\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Topic :: Scientific/Engineering :: GIS\",\n        \"Topic :: Scientific/Engineering :: Information Analysis\",\n    ],\n\n    packages=find_packages(\n        exclude=('tests', 'tests.*',\n                 'integration_tests', 'integration_tests.*')\n    ),\n    package_data={\n        '': ['*.yaml', '*/*.yaml'],\n    },\n    scripts=[\n        'datacube_apps/scripts/pbs_helpers.sh'\n    ],\n    setup_requires=[\n        'pytest-runner'\n    ],\n    install_requires=[\n        'affine',\n        'cachetools',\n        'click>=5.0',\n        'cloudpickle>=0.4',\n        'dask[array]',\n        'gdal>=1.9',\n        'jsonschema',\n        'netcdf4',\n        'numpy',\n        'pathlib;python_version<\"3\"',\n        'psycopg2',\n        'pypeg2',\n        'python-dateutil',\n        'pyyaml',\n        'rasterio>=0.9a10',  # required for zip reading, 0.9 gets around 1.0a ordering problems\n        'singledispatch',\n        'sqlalchemy',\n        'xarray>=0.9',  # >0.9 fixes most problems with `crs` attributes being lost\n    ],\n    extras_require=extras_require,\n    tests_require=tests_require,\n\n    entry_points={\n        'console_scripts': [\n            'datacube = datacube.scripts.cli_app:cli',\n            'datacube-search = datacube.scripts.search_tool:cli',\n            'datacube-stacker = datacube_apps.stacker:main',\n            'datacube-worker = datacube.execution.worker:main',\n            'datacube-fixer = datacube_apps.stacker:fixer_main',\n            'datacube-ncml = datacube_apps.ncml:ncml_app',\n            'pixeldrill = datacube_apps.pixeldrill:main [interactive]',\n            'movie_generator = datacube_apps.movie_generator:main',\n            'datacube-simple-replica = datacube_apps.simple_replica:replicate [replicas]'\n        ],\n        'datacube.plugins.io.read': [\n            'netcdf = datacube.drivers.netcdf.driver:reader_driver_init',\n            's3aio = datacube.drivers.s3.driver:reader_driver_init',\n            's3aio_test = datacube.drivers.s3.driver:reader_test_driver_init'\n        ],\n        'datacube.plugins.io.write': [\n            'netcdf = datacube.drivers.netcdf.driver:writer_driver_init',\n            's3aio = datacube.drivers.s3.driver:writer_driver_init',\n            's3aio_test = datacube.drivers.s3.driver:writer_test_driver_init',\n        ],\n        'datacube.plugins.index': [\n            'default = datacube.index.index:index_driver_init',\n            's3aio_index = datacube.drivers.s3aio_index:index_driver_init',\n        ],\n    },\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\nimport versioneer\nfrom setuptools import setup, find_packages\n\ntests_require = [\n    'compliance-checker',\n    'hypothesis',\n    'mock',\n    'objgraph',\n    'pycodestyle',\n    'pylint',\n    'pytest',\n    'pytest-cov',\n    'pytest-timeout',\n]\n\nextras_require = {\n    'performance': ['ciso8601', 'bottleneck'],\n    'interactive': ['matplotlib', 'fiona'],\n    'distributed': ['distributed', 'dask[distributed]'],\n    'analytics': ['scipy', 'pyparsing', 'numexpr'],\n    'doc': ['Sphinx', 'setuptools'],\n    'replicas': ['paramiko', 'sshtunnel', 'tqdm'],\n    'celery': ['celery>=4', 'redis'],\n    's3': ['boto3==1.4.3', 'SharedArray', 'pathos', 'zstandard'],\n    'test': tests_require,\n}\n# An 'all' option, following ipython naming conventions.\nextras_require['all'] = sorted(set(sum(extras_require.values(), [])))\n\nsetup(\n    name='datacube',\n    version=versioneer.get_version(),\n    cmdclass=versioneer.get_cmdclass(),\n    python_requires='>3.5.2',\n\n    url='https://github.com/opendatacube/datacube-core',\n    author='AGDC Collaboration',\n    maintainer='AGDC Collaboration',\n    maintainer_email='',\n    description='An analysis environment for satellite and other earth observation data',\n    long_description=open('README.rst').read(),\n    license='Apache License 2.0',\n    classifiers=[\n        \"Development Status :: 4 - Beta\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Natural Language :: English\",\n        \"Operating System :: MacOS :: MacOS X\",\n        \"Operating System :: POSIX\",\n        \"Operating System :: POSIX :: BSD\",\n        \"Operating System :: POSIX :: Linux\",\n        \"Operating System :: Microsoft :: Windows\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Topic :: Scientific/Engineering :: GIS\",\n        \"Topic :: Scientific/Engineering :: Information Analysis\",\n    ],\n\n    packages=find_packages(\n        exclude=('tests', 'tests.*',\n                 'integration_tests', 'integration_tests.*')\n    ),\n    package_data={\n        '': ['*.yaml', '*/*.yaml'],\n    },\n    scripts=[\n        'datacube_apps/scripts/pbs_helpers.sh'\n    ],\n    setup_requires=[\n        'pytest-runner'\n    ],\n    install_requires=[\n        'affine',\n        'cachetools',\n        'click>=5.0',\n        'cloudpickle>=0.4',\n        'dask[array]',\n        'gdal>=1.9',\n        'jsonschema',\n        'netcdf4',\n        'numpy',\n        'psycopg2',\n        'pypeg2',\n        'python-dateutil',\n        'pyyaml',\n        'rasterio>=0.9a10',  # required for zip reading, 0.9 gets around 1.0a ordering problems\n        'singledispatch',\n        'sqlalchemy',\n        'xarray>=0.9',  # >0.9 fixes most problems with `crs` attributes being lost\n    ],\n    extras_require=extras_require,\n    tests_require=tests_require,\n\n    entry_points={\n        'console_scripts': [\n            'datacube = datacube.scripts.cli_app:cli',\n            'datacube-search = datacube.scripts.search_tool:cli',\n            'datacube-stacker = datacube_apps.stacker:main',\n            'datacube-worker = datacube.execution.worker:main',\n            'datacube-fixer = datacube_apps.stacker:fixer_main',\n            'datacube-ncml = datacube_apps.ncml:ncml_app',\n            'pixeldrill = datacube_apps.pixeldrill:main [interactive]',\n            'movie_generator = datacube_apps.movie_generator:main',\n            'datacube-simple-replica = datacube_apps.simple_replica:replicate [replicas]'\n        ],\n        'datacube.plugins.io.read': [\n            'netcdf = datacube.drivers.netcdf.driver:reader_driver_init',\n            's3aio = datacube.drivers.s3.driver:reader_driver_init',\n            's3aio_test = datacube.drivers.s3.driver:reader_test_driver_init'\n        ],\n        'datacube.plugins.io.write': [\n            'netcdf = datacube.drivers.netcdf.driver:writer_driver_init',\n            's3aio = datacube.drivers.s3.driver:writer_driver_init',\n            's3aio_test = datacube.drivers.s3.driver:writer_test_driver_init',\n        ],\n        'datacube.plugins.index': [\n            'default = datacube.index.index:index_driver_init',\n            's3aio_index = datacube.drivers.s3aio_index:index_driver_init',\n        ],\n    },\n)\n", "path": "setup.py"}]}