some uses of str.format remain, but converting them would be more trouble than it's worth (cherry picked from commit f17cffa3ec)
f17cffa3ec
(cherry picked from commit 837d6b378e)
837d6b378e