def METHOD_NAME(archive, remove):
    '''
    Verify the egg release file is read from file and
    written to the archive, even if the file cannot be deleted
    '''
    if six.PY3:
        open_name = 'builtins.open'
    else:
        open_name = '__builtin__.open'
    remove.side_effect = OSError('test')
    with patch(open_name, create=True) as mock_open:
        mock_open.side_effect = [mock.mock_open(read_data='/testvalue').return_value]
        c = InsightsConfig()
        d = DataCollector(c)
        d._write_egg_release()
        remove.assert_called_once_with(constants.egg_release_file)
        d.archive.add_metadata_to_archive.assert_called_once_with('/testvalue', '/egg_release')