fix HTML wrapping for bytes strings in Py3

--HG--
extra : transplant_source : %FA%A2p%CD%F9b%DD%AC%01%5E%CAt1%14%9C%97%C12b%5E
fix HTML wrapping for bytes strings in Py3
merge 3.3 branch into master