[Git][debian-gis-team/pyorbital][upstream] New upstream version 1.12.1

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Sat Mar 7 15:56:45 GMT 2026



Antonio Valentino pushed to branch upstream at Debian GIS Project / pyorbital


Commits:
4ca38ee6 by Antonio Valentino at 2026-03-07T15:46:21+00:00
New upstream version 1.12.1
- - - - -


4 changed files:

- .pre-commit-config.yaml
- CHANGELOG.md
- pyorbital/tests/test_tlefile.py
- pyorbital/tlefile.py


Changes:

=====================================
.pre-commit-config.yaml
=====================================
@@ -3,7 +3,7 @@ fail_fast: false
 repos:
   - repo: https://github.com/astral-sh/ruff-pre-commit
     # Ruff version.
-    rev: 'v0.14.14'
+    rev: 'v0.15.4'
     hooks:
       - id: ruff
   - repo: https://github.com/pre-commit/pre-commit-hooks
@@ -15,7 +15,7 @@ repos:
       - id: check-yaml
         args: [--unsafe]
   - repo: https://github.com/PyCQA/bandit
-    rev: '1.9.3' # Update me!
+    rev: '1.9.4' # Update me!
     hooks:
       - id: bandit
         args: [--ini, .bandit]
@@ -30,7 +30,7 @@ repos:
           - types-requests
         args: ["--python-version", "3.10", "--ignore-missing-imports"]
   - repo: https://github.com/pycqa/isort
-    rev: 7.0.0
+    rev: 8.0.1
     hooks:
       - id: isort
         language_version: python3


=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,14 @@
+## Version 1.12.1 (2026/03/05)
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 223](https://github.com/pytroll/pyorbital/pull/223) - Bugfix `Downloader` handling of trailing empty lines
+
+In this release 1 pull request was closed.
+
+
 ## Version 1.12.0 (2026/02/06)
 
 ### Issues Closed


=====================================
pyorbital/tests/test_tlefile.py
=====================================
@@ -499,10 +499,10 @@ FETCH_SPACETRACK_CONFIG = {
 }
 
 
-class TestDownloader(unittest.TestCase):
+class TestDownloader:
     """Test TLE downloader."""
 
-    def setUp(self):
+    def setup_method(self):
         """Create a downloader instance."""
         from pyorbital.tlefile import Downloader
         self.config = {}
@@ -648,11 +648,20 @@ class TestDownloader(unittest.TestCase):
         assert res[0].line1 == LINE1
         assert res[0].line2 == LINE2
 
-    def test_read_tle_files(self):
+    @pytest.mark.parametrize(
+        "tle_lines", [(LINE1, LINE2),
+                      (LINE1, LINE2, ""),
+                      (LINE1, LINE2, "", ""),
+                      (LINE0, LINE1, LINE2),
+                      (LINE0, LINE1, LINE2, ""),
+                      (LINE0, LINE1, LINE2, "", ""),
+                      ]
+    )
+    def test_read_tle_files(self, tle_lines):
         """Test reading TLE files from a file system."""
         from tempfile import TemporaryDirectory
 
-        tle_text = "\n".join((LINE0, LINE1, LINE2))
+        tle_text = "\n".join(tle_lines)
 
         save_dir = TemporaryDirectory()
         with save_dir:


=====================================
pyorbital/tlefile.py
=====================================
@@ -415,23 +415,34 @@ def _decode_lines(fid, l_0, platform, only_first, open_is_dummy=False):
     designator = "1 " + SATELLITES.get(platform, "")
     tle = ""
     l_0 = _decode(l_0)
-    if l_0.strip() == platform:
-        l_1 = _decode(next(fid))
-        l_2 = _decode(next(fid))
-        tle = _merge_tle_from_two_lines(l_1, l_2)
+    if l_0.strip() == platform and platform != "":
+        tle = _decode_lines_with_platform_header(fid)
     elif l_0.strip().startswith(designator):
-        if (platform in SATELLITES or not only_first) or open_is_dummy:
-            l_1 = l_0
-            l_2 = _decode(next(fid))
-            tle = _merge_tle_from_two_lines(l_1, l_2)
-            if platform:
-                LOGGER.debug("Found platform %s, ID: %s", platform, SATELLITES[platform])
+        tle = _decode_lines_without_platform_header(fid, l_0, platform, only_first, open_is_dummy)
     elif l_0.startswith(platform) and platform not in SATELLITES:
         LOGGER.debug("Found a possible match: %s?", str(l_0.strip()))
 
     return tle
 
 
+def _decode_lines_with_platform_header(fid):
+    l_1 = _decode(next(fid))
+    l_2 = _decode(next(fid))
+    tle = _merge_tle_from_two_lines(l_1, l_2)
+    return tle
+
+
+def _decode_lines_without_platform_header(fid, l_0, platform, only_first, open_is_dummy):
+    tle = ""
+    if (platform in SATELLITES or not only_first) or open_is_dummy:
+        l_1 = l_0
+        l_2 = _decode(next(fid))
+        tle = _merge_tle_from_two_lines(l_1, l_2)
+        if platform:
+            LOGGER.debug("Found platform %s, ID: %s", platform, SATELLITES[platform])
+    return tle
+
+
 def _merge_tle_from_two_lines(l_1, l_2):
     """Merge line1 and line2 to fulle TLE string."""
     return l_1.strip() + "\n" + l_2.strip()



View it on GitLab: https://salsa.debian.org/debian-gis-team/pyorbital/-/commit/4ca38ee670c0a8c7620f0f7e370491a770c1a409

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyorbital/-/commit/4ca38ee670c0a8c7620f0f7e370491a770c1a409
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20260307/9732e540/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list