fix use of locals() in strings

hacking 0.6 brings in H501, don't use locals() in strings, as it
has the ability to hide errors. This fixes it in preparation of
landing hacking 0.6.

Change-Id: I7972befbb945a27ed8aa601975205736038eefa2