def fix_read_only(fname):
    '''Removes read only attribute if file is read only'''
    fileattr = os.stat(fname)[0] 
    if (not fileattr & stat.S_IWRITE):
        logging.info('Fixing read only file: ' + fname)
        os.chmod(fname, stat.S_IWRITE)
Removes read only attribute if file is read only
recipes/Python/576903_Subversion_Directory_Removal/recipe-576903.py