Fixed saving to file like object test in Python 3.