From 4765331cbdea91a1b65afe9b962b2e0ea4e4cf86 Mon Sep 17 00:00:00 2001 From: "Michael Hirsch, Ph.D" Date: Mon, 10 Feb 2020 04:09:34 -0500 Subject: [PATCH] don't crash on truncated files --- georinex/obs2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/georinex/obs2.py b/georinex/obs2.py index 60d69b3..08f1a3c 100644 --- a/georinex/obs2.py +++ b/georinex/obs2.py @@ -578,6 +578,7 @@ def _fast_alloc(fn: Union[TextIO, Path], Nl_sv: int) -> int: else: raise TypeError(f'Unknown filetype {type(fn)}') + ln = "" # in case of truncated file, don't crash with opener(fn) as f: _skip_header(f) # %% find the first line with time (sometimes a blank line or two after header)