Trailing newline in TLE source breaks fetch_tle_from_url
Steps to reproduce
from satellite_tle import fetch_tles
tles = fetch_tles([25544,4298])
This produces the following error log:
----> 1 tles = fetch_tles([25544,4298])
/path/satellite_tle/fetch_tles.py in fetch_tles(requested_norad_ids, verify)
51 logging.info('Fetch from {}'.format(url))
52 try:
---> 53 new_tles = fetch_tles_from_url(url=url, verify=verify)
54 logging.debug('Found TLEs for {}'.format(list(new_tles.keys())))
55 except (requests.HTTPError, requests.Timeout):
/path/satellite_tle/fetch_tle.py in fetch_tles_from_url(url, verify)
88 # Loop over TLEs
89 for i in range(len(lines) - 2):
---> 90 if (lines[i + 1][0] == "1") & (lines[i + 2][0] == "2"):
91 try:
92 twoline2rv(lines[i + 1], lines[i + 2], wgs72)
IndexError: string index out of range
Explanation
Currently https://www.amsat.org/amsat/ftp/keps/current/nasabare.txt contains a trailing newline.