dirmap icon indicating copy to clipboard operation
dirmap copied to clipboard

fix: Python 3.12 compatibility and regex warning cleanup

Open sondt99 opened this issue 1 year ago • 1 comments

Summary

This PR fixes compatibility issues with Python 3.12 and resolves warnings when running dirmap.

Changes

  • common.py
    • Converted regex patterns to use raw strings (r"...") to avoid SyntaxWarning: invalid escape sequence.
  • option.py
    • Replaced deprecated imp module with importlib / SourceFileLoader for Python 3.12 compatibility.
    • Removed unused imports (ipaddress, IPy, importlib.util).
    • Cleaned up error handling and simplified target parsing logic.

Motivation

  • Ensure dirmap runs on Python ≥3.12 without errors.
  • Improve code maintainability by removing obsolete and unused code.

Testing

  • Verified on Python 3.12.
  • Ran python3 dirmap.py -h and confirmed the CLI works without warnings or import errors.

sondt99 avatar Aug 20 '25 02:08 sondt99

fix something that you can run in new python version

sondt99 avatar Nov 12 '25 05:11 sondt99