From 39a64a0fd79f4ac05cf51fdf2c647feafc68b533 Mon Sep 17 00:00:00 2001 From: rajputa Date: Mon, 27 Oct 2025 01:04:08 +0530 Subject: [PATCH] Fix copy_file function --- distutils/file_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distutils/file_util.py b/distutils/file_util.py index 0acc8cb8..2ebd671d 100644 --- a/distutils/file_util.py +++ b/distutils/file_util.py @@ -161,9 +161,9 @@ def copy_file( # noqa: C901 # According to David Ascher , utime() should be done # before chmod() (at least under NT). if preserve_times: - os.utime(dst, (st[ST_ATIME], st[ST_MTIME])) + os.utime(dst, (st.st_atime, st.st_mtime)) if preserve_mode: - os.chmod(dst, S_IMODE(st[ST_MODE])) + os.chmod(dst, S_IMODE(st.st_mode)) return (dst, True)