From 30af5e1d1f201d8681faf0ca163c4c9509de69a3 Mon Sep 17 00:00:00 2001 From: diederikvdv <54837990+diederikvdv@users.noreply.github.com> Date: Fri, 10 Jan 2025 16:00:27 +0100 Subject: [PATCH] Add newline inclusive disclaimer (#1770) --- fsspec/spec.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fsspec/spec.py b/fsspec/spec.py index 7daf850e7..b0b1ee509 100644 --- a/fsspec/spec.py +++ b/fsspec/spec.py @@ -2131,7 +2131,7 @@ def readuntil(self, char=b"\n", blocks=None): return b"".join(out) def readline(self): - """Read until first occurrence of newline character + """Read until and including the first occurrence of newline character Note that, because of character encoding, this is not necessarily a true line ending. @@ -2148,7 +2148,7 @@ def __iter__(self): return self def readlines(self): - """Return all data, split by the newline character""" + """Return all data, split by the newline character, including the newline character""" data = self.read() lines = data.split(b"\n") out = [l + b"\n" for l in lines[:-1]]