Serhiy Storchaka added the comment: Here is corrected patch (it uses relative seek()) with a lot of tests. ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue5202> _______________________________________