This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ianare
Recipients amaury.forgeotdarc, christian.heimes, draghuram, facundobatista, gvanrossum, ianare
Date 2007-12-03.23:39:16
SpamBayes Score 0.188528
Marked as misclassified No
Message-id <1196725156.56.0.411117881455.issue1545@psf.upfronthosting.co.za>
In-reply-to
Content
Rather than try in copytree and try again in copy2, why not add this to
the root of the issue - copystat. Something like this?


def copystat(src, dst, ignore_permission_err=False):
    """Copy all stat info (mode bits, atime and mtime) from src to dst"""
    st = os.stat(src)
    mode = stat.S_IMODE(st.st_mode)
    try:
        if hasattr(os, 'utime'):
            os.utime(dst, (st.st_atime, st.st_mtime))
        if hasattr(os, 'chmod'):
            os.chmod(dst, mode)
    except OSError, err:
        if WindowsError is not None and isinstance(err, WindowsError):
            pass
        elif ignore_permissions_err and err.errno == errno.EPERM:
            pass
        else:
            raise
History
Date User Action Args
2007-12-03 23:39:16ianaresetspambayes_score: 0.188528 -> 0.188528
recipients: + ianare, gvanrossum, facundobatista, amaury.forgeotdarc, draghuram, christian.heimes
2007-12-03 23:39:16ianaresetspambayes_score: 0.188528 -> 0.188528
messageid: <1196725156.56.0.411117881455.issue1545@psf.upfronthosting.co.za>
2007-12-03 23:39:16ianarelinkissue1545 messages
2007-12-03 23:39:16ianarecreate