Serhiy Storchaka added the comment: I am not sure if escape() should support bytes. translate() doesn't. ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue8402> _______________________________________