Serhiy Storchaka added the comment: Python 3.5: >>> bytearray(b'%d') % 42 bytearray(b'42') Python 3.6: >>> bytearray(b'%d') % 42 b'42' ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue26766> _______________________________________