diff options
Diffstat (limited to 'astro/py-ephem/files/patch-setup.py')
-rw-r--r-- | astro/py-ephem/files/patch-setup.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/astro/py-ephem/files/patch-setup.py b/astro/py-ephem/files/patch-setup.py new file mode 100644 index 000000000000..184acbc7f0f0 --- /dev/null +++ b/astro/py-ephem/files/patch-setup.py @@ -0,0 +1,31 @@ +--- setup.py.orig 2019-08-17 17:39:14 UTC ++++ setup.py +@@ -1,4 +1,13 @@ ++# Currently ephem fails if the text files contain unicode characters. ++# To fix this we need to open the files as utf-8 explicitly. ++# Since open() in Python 2 doesn't support an encoding parameter, ++# TODO: Upstream ++# ++# Add setup.py test command support to run tests ++# TODO: Upstream ++ + import os ++import io + import sys + from distutils.core import setup, Extension + from glob import glob +@@ -24,7 +33,7 @@ libastro_files = glob('libastro-%s/*.c' % libastro_ver + libastro_data = glob('extensions/data/*.c') + + def read(*filenames): +- return open(os.path.join(os.path.dirname(__file__), *filenames)).read() ++ return io.open(os.path.join(os.path.dirname(__file__), *filenames), encoding="utf-8").read() + + extensions = [ + Extension('ephem._libastro', +@@ -62,4 +71,5 @@ setup(name = 'ephem', + 'tests/usno/*.txt', + ],}, + ext_modules = extensions, ++ test_suite='ephem.tests', + ) |