Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@shank250
Copy link

@shank250 shank250 commented Apr 1, 2025

Fix: Replace Deprecated distutils & Ensure .tests Directory Exists

Issue Summary

This PR addresses two issues:

  1. Deprecation Warning:

    • distutils is deprecated in Python 3.12 and will be removed.
    • Replaced distutils.dir_util.copy_tree(src, dest, update=1) with shutil.copytree and shutil.copy2.
  2. FileNotFoundError in .tests Directory:

    • Sometimes, the .tests folder was missing, leading to an error when trying to write app_fs_init.sh.
    • Fix: Added os.makedirs(test_dir, exist_ok=True) to ensure the directory exists.

Changes Made

  • ✅ Replaced distutils usage with os.makedirs and shutil for better compatibility.
  • ✅ Added os.makedirs(test_dir, exist_ok=True) to prevent FileNotFoundError.

Impact

  • Fixes compatibility with Python 3.12.
  • Ensures the .tests directory is always available.

Reviewers: @razvand

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.

1 participant