changeset 346:bc1440870a4e trim

fixed last-buffer bug
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Wed, 11 Mar 2026 18:07:41 +0000
parents 8c9e7578ed30
children 55b155c11d8f
files lib/python/cc/warc.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/python/cc/warc.py	Wed Mar 11 16:08:35 2026 +0000
+++ b/lib/python/cc/warc.py	Wed Mar 11 18:07:41 2026 +0000
@@ -206,7 +206,8 @@
       with memoryview(buf)[keepLen:BUFSIZE] as xBuf:
         nb=f.readinto(xBuf)
       bl = keepLen+nb
-      done = bl < BUFSIZE 
+      if (done := (bl < BUFSIZE)):
+        bufView = bufView[0:bl]
       bp = 0
   fp.close()
   f.close()