← TechnologyThe essentials of

Shutil.copy2: copying does not preserve every attribute

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 16:11 · Updated: 22 Oct 2026 16:11

AI source check: 22 Oct 2026 14:04. This is not editorial approval.

In a few sentences

In brief

shutil.copy2() attempts to preserve more file metadata than merely copying contents. The documentation warns that even high-level copying cannot transfer every attribute on every platform.

Useful to know

shutil.copy2() attempts to preserve more file metadata than merely copying contents. The documentation warns that even high-level copying cannot transfer every attribute on every platform. [1]

For backups or migration, establish whether ownership, permissions or special streams matter. Checking file size alone does not prove complete equivalence. Contents and their access context are different parts of the task.

Sources

For further detail and to check the information:

  1. [1] shutil — High-level file operations — Python 3.12.15 documentation ↗