Fix a string type issue in ShellCheck and generally in unit tests.

Review Request #12891 — Created March 14, 2023 and submitted — Latest diff uploaded

Information

ReviewBot
release-3.x

Reviewers

In production on Python 3, ShellCheck would fail due to a string type
issue when trying to build replacement strings. This was missed in unit
tests due to an assumption being made that byte strings are appropriate
for diff content in "diff data" result from the API, when in fact those
must be Unicode strings, since the result is JSON (and encoding is
handled on the Review Board side).

Addressing this required fixing up the mismatch in the ShellCheck code,
and also updating the unit test helpers run_tool_execute() and
run_get_can_handle_file() to convert any sample bytestring content to
Unicode when building up a diff data payload.

Unit tests pass on all supported versions of Python.

Verified the ShellCheck fix with a customer.

Commits

Files

    Loading...