changeset 43:69be1131bcc5

get EOF right, finally
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Wed, 05 Jul 2023 17:49:24 +0100
parents 689a0e311cd2
children 083229195d12
files bin/warc.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/bin/warc.py	Wed Jul 05 15:37:16 2023 +0100
+++ b/bin/warc.py	Wed Jul 05 17:49:24 2023 +0100
@@ -17,8 +17,8 @@
     while l==b'\r\n':
       l=stream.readline()
       nb+=(ln:=len(l))
-      if ln==0:
-        break
+    if ln==0:
+      break
     if l!=b'WARC/1.0\r\n':
       raise ValueError("Not a WARC file? At %s: %s[%s]"%(nb-len(l),
                                                          l.decode('latin-1'),len(l)))