__init__.py 文件源码

python
阅读 14 收藏 0 点赞 0 评论 0

项目:ivaochdoc 作者: ivaoch 项目源码 文件源码
def rmtree_errorhandler(func, path, exc_info):
    """On Windows, the files in .svn are read-only, so when rmtree() tries to
    remove them, an exception is thrown.  We catch that here, remove the
    read-only attribute, and hopefully continue without problems."""
    # if file type currently read only
    if os.stat(path).st_mode & stat.S_IREAD:
        # convert to read/write
        os.chmod(path, stat.S_IWRITE)
        # use the original function to repeat the operation
        func(path)
        return
    else:
        raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号