cwtags #4502759 UStringIO monkeypatch breaks assertions in write() [validation pending]

UStringIO.write() has assertions to make sure that only Unicode strings are given to it. The ways cwtags monkeypatches UStringIO has many drawbacks:

  • it bypasses completely the assertion in place, allowing anything to be given to write(),
  • the monkeypatch of getvalue() worsens this by implicitely calling unicode() on the content,
  • the current implementation depends on the knowledge of UStringIO's implementation (namely, the fact that UStringIO inherits from list)

A better approach would be to call the original method from the monkeypatch (much like a super call would) to get all the benefits from the original method, while adding new handling for tag objects.

done in1.1.0
load left0.000
closed by#2ef6fd5f98cd Extend cw's UStringIO, don't break it (closes #4502759)
patchExtend cw's UStringIO, don't break it (closes #4502759) [applied]