diff options
author | Kenn Knowles <kenn.knowles@gmail.com> | 2013-05-01 18:00:42 -0400 |
---|---|---|
committer | Kenn Knowles <kenn.knowles@gmail.com> | 2013-05-01 18:00:42 -0400 |
commit | c1d5e6aaa55697d468dc692781a4c78d1b8fe243 (patch) | |
tree | 9686198324c5534a6bf6713d6bc2c37755e4fb18 | |
parent | 03e57bfdb50c8cf24474cbb1fa0861c10b80e4f5 (diff) | |
download | jsonpath-rw-c1d5e6aaa55697d468dc692781a4c78d1b8fe243.tar.gz |
Just survive any errors reading the long description
-rw-r--r-- | setup.py | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -9,8 +9,13 @@ import subprocess if not os.path.exists('README.txt') and 'sdist' in sys.argv: subprocess.call(['pandoc', '--to=rst', '--smart', '--output=README.txt', 'README.md']) -# But use the best README around -readme = 'README.txt' if os.path.exists('README.txt') else 'README.md' +# But use the best README around; never fail - there are some Windows locales that seem to die on smartquotes, +# even with the explicit encoding +try: + readme = 'README.txt' if os.path.exists('README.txt') else 'README.md' + long_description = io.open(readme, encoding='utf-8').read() +except: + long_description = 'Could not read README.txt' setuptools.setup( name='jsonpath-rw', @@ -20,7 +25,7 @@ setuptools.setup( author_email='kenn.knowles@gmail.com', url='https://github.com/kennknowles/python-jsonpath-rw', license='Apache 2.0', - long_description=io.open(readme, encoding='utf-8').read(), + long_description=long_description, packages = ['jsonpath_rw'], test_suite = 'tests', install_requires = [ 'ply', 'decorator', 'six' ], |