Skip to content

Commit

Permalink
Merge r951231 from trunk to 1.3 branch. Fixes: AVRO-559.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/avro/branches/branch-1.3@951232 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Jeffrey Evan Hammerbacher committed Jun 4, 2010
1 parent e1de8c0 commit 913345d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Avro 1.3.3 (Unreleased)

AVRO-560. Python impl should include system errors in every protocol (hammer)

AVRO-559. Handle read_union error where the list index of the union branch
to follow exceeds the size of the union schema (hammer)

BUG FIXES

AVRO-496. python sample_http_client.py is broken (Jeff Hodges via hammer)
Expand Down
4 changes: 4 additions & 0 deletions lang/py/src/avro/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,10 @@ def read_union(self, writers_schema, readers_schema, decoder):
"""
# schema resolution
index_of_schema = int(decoder.read_long())
if index_of_schema >= len(writers_schema.schemas):
fail_msg = "Can't access branch index %d for union with %d branches"\
% (index_of_schema, writers_schema.schemas)
raise SchemaResolutionException(fail_msg, writers_schema, readers_schema)
selected_writers_schema = writers_schema.schemas[index_of_schema]

# read data
Expand Down

0 comments on commit 913345d

Please sign in to comment.