8000 Just survive any errors reading the long description · cdent/python-jsonpath-rw@c1d5e6a · GitHub
[go: up one dir, main page]

Skip to content

Commit c1d5e6a

Browse files
kennknowleskennknowlescommitted
Just survive any errors reading the long description
1 parent 03e57bf commit c1d5e6a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

setup.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
if not os.path.exists('README.txt') and 'sdist' in sys.argv:
1010
subprocess.call(['pandoc', '--to=rst', '--smart', '--output=README.txt', 'README.md'])
1111

12-
# But use the best README around
13-
readme = 'README.txt' if os.path.exists('README.txt') else 'README.md'
12+
# But use the best README around; never fail - there are some Windows locales that seem to die on smartquotes,
13+
# even with the explicit encoding
14+
try:
15+
readme = 'README.txt' if os.path.exists('README.txt') else 'README.md'
16+
long_description = io.open(readme, encoding='utf-8').read()
17+
except:
18+
long_description = 'Could not read README.txt'
1419

1520
setuptools.setup(
1621
name='jsonpath-rw',
@@ -20,7 +25,7 @@
2025
author_email='kenn.knowles@gmail.com',
2126
url='https://github.com/kennknowles/python-jsonpath-rw',
2227
license='Apache 2.0',
23-
long_description=io.open(readme, encoding='utf-8').read(),
28+
long_description=long_description,
2429
packages = ['jsonpath_rw'],
2530
test_suite = 'tests',
2631
install_requires = [ 'ply', 'decorator', 'six' ],

0 commit comments

Comments
 (0)
0