Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • P python-satellitetle
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • librespacefoundation
  • python-satellitetle
  • Issues
  • #12
Closed
Open
Created Dec 17, 2019 by Fabian P. Schmidt@kerel-fsMaintainer

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.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking