STINNER Victor added the comment: Maybe you can a new truncate operation to unicode writer? As you want. The patch looks good to me. ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue20538> _______________________________________