diff --git a/python/ptolemy/ptolemyVariety.py b/python/ptolemy/ptolemyVariety.py index 1e38d220..40e60c23 100644 --- a/python/ptolemy/ptolemyVariety.py +++ b/python/ptolemy/ptolemyVariety.py @@ -599,7 +599,7 @@ def retrieve_solutions(self, numerical=False, data_url=None, verbose=True): - exts = ['magma_out', 'rur'] + exts = ['magma_out.gz', 'magma_out', 'rur'] if prefer_rur: exts = exts[::-1] @@ -993,8 +993,14 @@ def _retrieve_url(url): if sigalrm_handler: # Not supported under windows signal.signal(signal.SIGALRM, sigalrm_handler) + text = s.read() + + if url.endswith('.gz'): + import gzip + text = gzip.decompress(text) + # Read the text - text = s.read().decode('ascii').replace('\r\n', '\n') + text = text.decode('ascii').replace('\r\n', '\n') if not (url.startswith('http:') or url.startswith('https')): # If this is a normal file, we are done