def write_cache_file(source_cache_d, key_filenames, rosdep_data):
    if not os.path.exists(source_cache_d):
        os.makedirs(source_cache_d)
    key_hash = compute_filename_hash(key_filenames)
    filepath = os.path.join(source_cache_d, key_hash)
    try:
        write_atomic(filepath + PICKLE_CACHE_EXT, pickle.dumps(rosdep_data, -1), True)
    except OSError as e:
        raise CachePermissionError("Failed to write cache file: " + str(e))
    try:
        os.unlink(filepath)
    except OSError:
        pass
    return filepath
Localized TimeFields in a non-localized environment act as unlocalized widgets
dataset/ETHPy150Open ros-infrastructure/rosdep/src/rosdep2/sources_list.py/write_cache_file--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/tests/regressiontests/forms/tests/input_formats.py/SimpleTimeFormatTests.test_localized_timeField