Skip to content

python: Fixed byte compare - #3710

Merged
RyanSkraba merged 1 commit into
apache:mainfrom
vallsv:patch-1
May 2, 2026
Merged

RyanSkraba merged 1 commit into
apache:mainfrom
vallsv:patch-1

Conversation

@vallsv

@vallsv vallsv commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

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 bytes

We was getting struct.error: unpack requires a buffer of 4 bytes

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Documentation

  • Does this pull request introduce a new feature? (no)

@RyanSkraba
RyanSkraba merged commit 2cd8431 into apache:main May 2, 2026
22 checks passed
@RyanSkraba

Copy link
Copy Markdown
Contributor

Cherry-picked to branch-1.12.

RyanSkraba pushed a commit that referenced this pull request May 2, 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants