rdblue commented on code in PR #6532:
URL: https://github.com/apache/iceberg/pull/6532#discussion_r1063849334
##########
python/pyiceberg/avro/decoder.py:
##########
@@ -50,10 +50,10 @@ def read(self, n: int) -> bytes:
raise ValueError(f"Requested {n} bytes to read, expected positive
integer.")
read_bytes = self._input_stream.read(n)
read_len = len(read_bytes)
- if read_len <= 0:
- raise EOFError
+ if read_len < 0:
+ raise EOFError(f"Got negative length: {read_len}")
Review Comment:
Just to capture this somewhere, Python does use [0 bytes to signal
EOF](https://docs.python.org/3/library/io.html#io.RawIOBase.read):
> If 0 bytes are returned, and size was not 0, this indicates end of file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]