'Internal: raise a ValueError if file is closed'

def _checkClosed(self, msg=None):

    if self.closed:
        raise ValueError((u'I/O    operation    on    closed    file.' if (msg is None) else msg))
