Fixing 'exceptions.IOError' object has no attribute 'problem'