From 11aee0f43a76ccd2aee144e3d9714e2ce50a12dc Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Tue, 13 May 2025 19:06:47 +0900 Subject: [PATCH] =?UTF-8?q?style:=20=E6=9B=B4=E3=81=AB=E3=82=B3=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecs/dataimport/dataimport/chk.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ecs/dataimport/dataimport/chk.py b/ecs/dataimport/dataimport/chk.py index dd4300b2..13e8f88b 100644 --- a/ecs/dataimport/dataimport/chk.py +++ b/ecs/dataimport/dataimport/chk.py @@ -301,11 +301,12 @@ def reverse_readline_stream(f: io.BytesIO, line_feed: str, chunk_size=4096): # 読み込んだチャンク + バッファ(途中行) buffer = chunk + buffer + # 改行文字で区切る parts = buffer.split(line_feed.encode()) # parts[0] は先頭途中行 → 次ループへ残す buffer = parts[0] - # parts[1:] が「完全に揃った行」のリスト + # 改行文字で区切っているため、行途中のparts[1:] は空文字になるため、以下のループは素通りする。 for line in reversed(parts[1:]): if not yielded_any and line == b'': # 最初にだけ出てくる空行を飛ばす