Fix build after #10727

This PR fix the build due to the changes introduced with #10727

I had a mistake with an instance variable.
I had to rewind StringIO instances before parsed it again.

I don't know if I need to squash but let me know in any case