raise a FileTypeError rather than a ValueError, so we can catch it later on