# Buggy code
def main():
    version = sys.version_info[:2]
    virtualenv_open = ["virtualenv>=1.11.2"]
    virtualenv_capped = ["virtualenv>=1.11.2,<14"]
    install_requires = ["py>=1.4.17", "pluggy>=0.3.0,<1.0", "six"]
    extras_require = {}
    if has_environment_marker_support():
        extras_require[':python_version=="2.6"'] = ["argparse"]
        extras_require[':python_version=="3.2"'] = virtualenv_capped
        extras_require[':python_version!="3.2"'] = virtualenv_open
    else:
        if version < (2, 7):
            install_requires += ["argparse"]
        install_requires += virtualenv_capped if version == (3, 2) else virtualenv_open
    setuptools.setup(
        name="tox",
        description="virtualenv-based automation of test activities",
        long_description=get_long_description(),
        url="https://tox.readthedocs.org/",
        use_scm_version=True,
        license="http://opensource.org/licenses/MIT",
        platforms=["unix", "linux", "osx", "cygwin", "win32"],
        author="holger krekel",
        author_email="holger@merlinux.eu",
        packages=["tox"],
        entry_points={
            "console_scripts": "tox=tox:cmdline\ntox-quickstart=tox._quickstart:main"
        },
        setup_requires=["setuptools_scm"],
        # we use a public tox version to test, see tox.ini's testenv
        # "deps" definition for the required dependencies
        tests_require=["tox"],
        cmdclass={"test": Tox},
        install_requires=install_requires,
        extras_require=extras_require,
        classifiers=[
            "Development Status :: 5 - Production/Stable",
            "Intended Audience :: Developers",
            "License :: OSI Approved :: MIT License",
            "Operating System :: POSIX",
            "Operating System :: Microsoft :: Windows",
            "Operating System :: MacOS :: MacOS X",
            "Topic :: Software Development :: Testing",
            "Topic :: Software Development :: Libraries",
            "Topic :: Utilities",
        ]
        + [
            ("Programming Language :: Python :: %s" % x)
            for x in "2 2.6 2.7 3 3.3 3.4 3.5 3.6".split()
        ],
    )


# Traceback (IOError)
running test
running egg_info
writing requirements to tox.egg-info/requires.txt
writing tox.egg-info/PKG-INFO
writing top-level names to tox.egg-info/top_level.txt
writing dependency_links to tox.egg-info/dependency_links.txt
writing entry points to tox.egg-info/entry_points.txt
reading manifest file 'tox.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'CHANGELOG'
writing manifest file 'tox.egg-info/SOURCES.txt'
running build_ext
using tox.ini: /usr/src/RPM/BUILD/python-module-tox-2.9.1/tox.ini
using tox-2.9.1 from /usr/src/RPM/BUILD/python-module-tox-2.9.1/tox/__init__.pyc
GLOB sdist-make: /usr/src/RPM/BUILD/python-module-tox-2.9.1/setup.py
/usr/src/RPM/BUILD/python-module-tox-2.9.1$ /usr/bin/python /usr/src/RPM/BUILD/python-module-tox-2.9.1/setup.py sdist --formats=zip --dist-dir /usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox/dist >/usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox/log/tox-0.log
py create: /usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox/py
/usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox$ /usr/bin/python -m virtualenv --python /usr/bin/python py >/usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox/py/log/py-0.log
py installdeps: pytest >= 3.0.0, pytest-cov, pytest-timeout, pytest-xdist
/usr/src/RPM/BUILD/python-module-tox-2.9.1$ /usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox/py/bin/pip install pytest >= 3.0.0 pytest-cov pytest-timeout pytest-xdist >/usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox/py/log/py-1.log
py inst: /usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox/dist/tox-2.9.1.zip
/usr/src/RPM/BUILD/python-module-tox-2.9.1$ /usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox/py/bin/pip install /usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox/dist/tox-2.9.1.zip >/usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox/py/log/py-2.log
ERROR: invocation failed (exit code 1), logfile: /usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox/py/log/py-2.log
ERROR: actionid: py
msg: installpkg
cmdargs: ['/usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox/py/bin/pip', 'install', '/usr/src/RPM/BUILD/python-module-tox-2.9.1/.tox/dist/tox-2.9.1.zip']

Processing ./.tox/dist/tox-2.9.1.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/src/tmp/pip-GO568q-build/setup.py", line 100, in <module>
main()
File "/usr/src/tmp/pip-GO568q-build/setup.py", line 68, in main
long_description=get_long_description(),
File "/usr/src/tmp/pip-GO568q-build/setup.py", line 45, in get_long_description
with io.open(os.path.join(here, 'CHANGELOG.rst'), encoding='utf-8') as g:
IOError: [Errno 2] No such file or directory: '/usr/src/tmp/pip-GO568q-build/CHANGELOG.rst'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /usr/src/tmp/pip-GO568q-build/

# Fixed code
def main():
    version = sys.version_info[:2]
    virtualenv_open = ["virtualenv>=1.11.2"]
    virtualenv_capped = ["virtualenv>=1.11.2,<14"]
    install_requires = ["py>=1.4.17", "pluggy>=0.3.0,<1.0", "six"]
    extras_require = {}
    if has_environment_marker_support():
        extras_require[':python_version=="2.6"'] = ["argparse"]
        extras_require[':python_version=="3.2"'] = virtualenv_capped
        extras_require[':python_version!="3.2"'] = virtualenv_open
    else:
        if version < (2, 7):
            install_requires += ["argparse"]
        install_requires += virtualenv_capped if version == (3, 2) else virtualenv_open
    setuptools.setup(
        name="tox",
        description="virtualenv-based automation of test activities",
        long_description=get_long_description(),
        url="https://tox.readthedocs.org/",
        use_scm_version=True,
        license="http://opensource.org/licenses/MIT",
        platforms=["unix", "linux", "osx", "cygwin", "win32"],
        author="holger krekel",
        author_email="holger@merlinux.eu",
        packages=["tox"],
        entry_points={
            "console_scripts": "tox=tox:cmdline\ntox-quickstart=tox._quickstart:main"
        },
        setup_requires=["setuptools_scm"],
        install_requires=install_requires,
        extras_require=extras_require,
        classifiers=[
            "Development Status :: 5 - Production/Stable",
            "Intended Audience :: Developers",
            "License :: OSI Approved :: MIT License",
            "Operating System :: POSIX",
            "Operating System :: Microsoft :: Windows",
            "Operating System :: MacOS :: MacOS X",
            "Topic :: Software Development :: Testing",
            "Topic :: Software Development :: Libraries",
            "Topic :: Utilities",
        ]
        + [
            ("Programming Language :: Python :: %s" % x)
            for x in "2 2.6 2.7 3 3.3 3.4 3.5 3.6".split()
        ],
    )