Following a recent Python update, I got an exception on a code developed to convert TLEs to J2000, using astropy.coordinates to perform a part of the work. This code is part of a suite developed in Py 3.6, even though I’m migrating to more recent Py versions. My local Py installation is managed by Conda, and kept regularly updated. Until recently, my code worked pretty well, also on other Py installations (always with Conda). Well, some days ago it sistematically crashed with the following traceback:
Traceback (most recent call last):
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/io/ascii/core.py", line 969, in _convert_vals
converter_func, converter_type = col.converters[0]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./TLE_TEME2J2000.py", line 463, in <module>
main()
File "./TLE_TEME2J2000.py", line 449, in main
conv(dati_glob)
File "./TLE_TEME2J2000.py", line 193, in conv
gcrs = itrs.transform_to(coord.GCRS(obstime=epoca_prop))
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/coordinates/baseframe.py", line 1220, in transform_to
return trans(self, new_frame)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/coordinates/transformations.py", line 1392, in __call__
curr_coord = t(curr_coord, curr_toframe)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/coordinates/transformations.py", line 928, in __call__
reprwithoutdiff = supcall(from_diffless, toframe)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/coordinates/builtin_frames/intermediate_rotation_transforms.py", line 87, in itrs_to_cirs
pmat = cirs_to_itrs_mat(itrs_coo.obstime)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/coordinates/builtin_frames/intermediate_rotation_transforms.py", line 31, in cirs_to_itrs_mat
xp, yp = get_polar_motion(time)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/coordinates/builtin_frames/utils.py", line 41, in get_polar_motion
iers_table = iers.earth_orientation_table.get()
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/utils/state.py", line 40, in get
return cls.validate(cls._value)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/utils/iers/iers.py", line 861, in validate
value = IERS_Auto.open()
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/utils/iers/iers.py", line 693, in open
cls.iers_table = cls.read(file=filename)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/utils/iers/iers.py", line 547, in read
iers_a = super().read(file, format='cds', readme=readme)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/table/connect.py", line 52, in __call__
out = registry.read(cls, *args, **kwargs)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/io/registry.py", line 523, in read
data = reader(*args, **kwargs)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/io/ascii/connect.py", line 18, in io_read
return read(filename, **kwargs)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/io/ascii/ui.py", line 323, in read
dat = reader.read(table)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/io/ascii/cds.py", line 327, in read
return super().read(table)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/io/ascii/core.py", line 1230, in read
table = self.outputter(cols, self.meta)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/io/ascii/core.py", line 1002, in __call__
self._convert_vals(cols)
File "/home/peron/miniconda3/envs/py3.6/lib/python3.6/site-packages/astropy/io/ascii/core.py", line 987, in _convert_vals
raise ValueError(f'Column {col.name} failed to convert: {last_err}')
ValueError: Column year failed to convert: invalid literal for int() with base 10: '<!'
This error appears to be sistematically reproducible, with both different input and more than one independent Conda environment (I also tried, e.g., Py 3.7 with same results). As far as I understand, this error was triggered after some of the environment updates recently done. I also tried reverting the environment to a version I was rather sure the code worked, but nothing different happened (environment corrupted?), and the same with a new environment created by purpose.
I would like to understand the reason of this strange (to me) behavior, and of course how to correct it. I’m rather new to Astropy (having mainly used astropy.time since), and perhaps the error is a trivial one (in fact it seems it’s related to only a single line of code).
Any help in understanding both is welcome, thanks in advance.