Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions sagemaker-core/src/sagemaker/core/iterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ def __next__(self):
# Stream ended with a trailing partial line (no "\n").
# `continue` alone would spin forever here: byte_iterator
# is already exhausted, so it keeps raising StopIteration
# and read_pos/buffer never change. Return the remainder
# once, so the next call correctly raises StopIteration.
self.buffer.seek(self.read_pos)
remainder = self.buffer.read()
self.read_pos += len(remainder)
return remainder
# and read_pos/buffer never change. `line` (read above)
# already holds this same remainder, since nothing moves
# the buffer between that read and here. Return it once,
# so the next call correctly raises StopIteration.
self.read_pos += len(line)
return line
raise
if "PayloadPart" not in chunk:
# handle API response errors and force terminate.
Expand Down
Loading