Update UnifiedDiffWriter to require an explicit stream.

Review Request #12658 — Created Sept. 30, 2022 and submitted

Information

RBTools
release-4.x

Reviewers

The initial design of UnifiedDiffWriter was self-contained,
subclassing io.BytesIO and therefore allowing any standard
operations like seek() or getvalue(). However, this is limiting, as
it means other types of streams (like a file) can be incrementally
written to.

This updates the design to require passing an explicit stream. This
simplifies the design a bit, and ensures a separation between diff
writing and stream operations.

Callers have all been updated to construct an explicit io.BytesIO to
pass to it, and now fetch their results from that method.

All unit tests pass.

Summary ID
Update UnifiedDiffWriter to require an explicit stream.
The initial design of `UnifiedDiffWriter` was self-contained, subclassing `io.BytesIO` and therefore allowing any standard operations like `seek()` or `getvalue()`. However, this is limiting, as it means other types of streams (like a file) can be incrementally written to. This updates the design to require passing an explicit stream. This simplifies the design a bit, and ensures a separation between diff writing and stream operations. Callers have all been updated to construct an explicit `io.BytesIO` to pass to it, and now fetch their results from that method.
df866e585b6baf157a87d72b8a5c0a71e39935fd
maubin
  1. Ship It!
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.x (b92d2dd)