I see. I did not expect such behavior actually. I wonder if it is the same with the new io.StringIO. Anyway, if it cannot be avoided let's just add a comment. It is surprising.