#! /usr/bin/env python

try:
    from setuptools import setup
    have_setuptools = True
except ImportError:
    from distutils.core import setup
    have_setuptools = False

VERSION = "0.5.123"
M_VERSION = "0.5"

setup_kwargs = {
    "version": VERSION,
    "description": 'The enlightened pager: less paging. more content. read widely.',
    "author": 'Paul Ivanov',
    "author_email": 'pi@berkeley.edu',
    "url": 'http://kant-en.org/',
    "download_url": "https://github.com/ivanov/kanten/zipball/" + M_VERSION,
    "classifiers": [
        "License :: OSI Approved",
        "License :: OSI Approved :: BSD License",
        "Intended Audience :: Developers",
        "Intended Audience :: System Administrators",
        "Programming Language :: Python",
        "Topic :: Utilities",
        ],
    "zip_safe": False,
    "data_files": [("", ['LICENSE', 'README.md']),],
    }

if have_setuptools:
    setup_kwargs['install_requires'] = [
        'Pygments >= 1.6',
        'urwid >= 1.1.1',
        ]

if __name__ == '__main__':
    setup(
        name='kanten',
        py_modules=['kanten'],
        entry_points={'console_scripts': ['kanten = kanten:main',],},
        long_description=open('README.md').read(),
        **setup_kwargs
        )

@@ -17,16 +17,27 @@
 python%0A%0A
+import io%0A%0A
 try:%0A   
@@ -1204,16 +1204,19 @@
 ription=
+io.
 open('RE
@@ -1223,16 +1223,34 @@
 ADME.md'
+, encoding='utf-8'
 ).read()

Fix failing setup.py on py3