victor martinez calvo: Tried contacting you in irc a few times, but i guess that didnt work
For the file: please use utf-8 without a BOM.
In case something fails halfway down the test, you do not close handles or restore previous values.
Instead of bailing out when a read fails, you might wanna just skip the test that it's for. (Optionally adding a skip("") warning the user that a read failed, thus that he might need to run the test as admin).