Skip to content

Conversation

PreistlyPython
Copy link

Summary

This PR fixes issue #5285 where the database file's timestamp was reset during import instead of preserving the original file's creation time.

Changes

  • Changed shutil.copy() to shutil.copy2() in the copy_db method to preserve file attributes including timestamps
  • Added comprehensive test test_import_preserves_file_timestamp() to verify timestamp preservation

Testing

  • New test added that verifies timestamp preservation during database import
  • All existing tests continue to pass

Fixes #5285

🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]

Use shutil.copy2() instead of shutil.copy() to preserve file attributes
including modification time when importing database files with --import
option.

Fixes intel#5285

- Changed shutil.copy to shutil.copy2 in copy_db method for import operation
- Added test to verify timestamp preservation during import
- Ensures database time reflects original file creation time, not import time

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: database time not preserved during file copy
1 participant