Antoine Pitrou added the comment: Thanks for the patch, Stephen. Could you add a test in Lib/test/test_io.py? ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue17671> _______________________________________