Repository navigation
python: Fixed byte compare - #3710
Merged
Merged
Conversation
martin-g
approved these changes
Mar 29, 2026
RyanSkraba
approved these changes
May 2, 2026
Contributor
|
Cherry-picked to branch-1.12. |
RyanSkraba
pushed a commit
that referenced
this pull request
May 2, 2026
This was referenced Nov 6, 2026
kojiromike
added a commit
to kojiromike/avro
that referenced
this pull request
Nov 6, 2026
This fixes the two avro.ipc and schema bugs from AVRO-3803 that are still on main. apache#2319 found them but has conflicts and has gone stale, and the bytes compare part already landed in apache#3710. This is based on apache#2319 by Ari Sosnovsky. In Responder.respond(), when an AvroException is raised after the handshake for an unreadable request, an unknown message, or a response that does not match its schema, the error was written to a throwaway BytesIO and the stale buffer returned, so the requestor got a decode error (InvalidAvroBinaryEncoding) instead of the server's error. Now it keeps the handshake response and replaces whatever followed it with the system error. Also, RecordSchema set the default namespace for nested types only when the type was "record", so types defined inside an "error" lost the error's namespace. The new tests are in-memory loopback requestor and responder tests for a full round trip including the first-contact handshake, for a system error reaching the requestor, and for a response that does not match its schema reaching the requestor as an error. They also include the empty-reader FramedReader test from apache#2319 and a schema test for error namespaces. The bug tests fail without the fix. Co-authored-by: Ari Sosnovsky <asosnovsky@users.noreply.github.com> Generated-by: Claude Code 2.1.314 (Claude Opus 5.5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Sounds like a typo due to the conversion from python2 to python3.
Instead of the message
avro.errors.ConnectionClosedException: Reader read 0 bytesWe was getting
struct.error: unpack requires a buffer of 4 bytesVerifying this change
This change is a trivial rework / code cleanup without any test coverage.
Documentation