Overview
ZIP archives routinely contain deeply nested folders and very long filenames. On Windows, extraction fails when the complete destination path exceeds the supported path length, when entry names contain characters forbidden by the filesystem, or when an archive smuggles in entries that write outside the destination folder. This tool exists to make that whole class of failure disappear.
ZIP Extractor with Path Fix shortens paths only when required, retains recognisable portions of filenames, appends deterministic SHA-1-based hashes to shortened names to avoid collisions, replaces Windows-invalid characters with underscores, adjusts reserved device names (CON, PRN, AUX, NUL, COM1–COM9, LPT1–LPT9), and blocks absolute paths and parent-directory traversal outright. When one entry fails, extraction continues with the rest.
It is aimed at Windows users first — the platform where path-length pain is real — but runs anywhere Python and Tkinter are available. Everything is local: no uploads, no accounts, no analytics. It suits IT support staff, developers, archivists and anyone who downloads source-code or data archives from the internet.
Use Cases
- Downloading source archives — deep
node_modules-style trees from GitHub or vendor portals extract without path errors.
- Unpacking data dumps — long-named CSV/JSON datasets land on disk safely with names you can still recognise.
- Batch-processing backup ZIPs — point "Add folder" at a directory of archives and extract them all in one run.
- Sanitising untrusted archives — Zip Slip and absolute-path entries are rejected before a single byte is written outside your target folder.
- Migrating legacy file shares — clean up invalid characters and reserved names automatically instead of one file at a time.
- Distributing a portable tool — build a single
ZIP-Extractor-Path-Fix.exe with PyInstaller for non-technical users.
- Preserving audit trails — original timestamps are kept where the archive stores them, and every rename/skip is logged.
- Working offline — a fully local utility with zero telemetry for sensitive or air-gapped environments.
A Typical Extraction Run
You double-click run.bat. The window opens instantly — it's plain Tkinter with no dependencies. You click Add folder and point it at your Downloads\vendor-archives directory; it finds eleven ZIPs and lists them. You set the output to C:\Extracted (a short path, as recommended for deep archives), keep the default maximum path length of 220, leave overwrite off and timestamps on, then hit Extract all. The background thread keeps the UI responsive; the progress bar advances while the activity log shows renamed entries like quarterly_financial_archive_document__a1b2c3d4.xlsx. Halfway through, one archive is damaged — the log marks its unreadable entries as skipped and the rest continue. You click Open output folder and spot-check the results. Total time: four minutes, zero manual renames.
Key Features
- Batch extraction — add individual archives or scan a folder for all
.zip files; each extracts into its own folder derived from the archive name (numbered suffix if it exists and overwrite is off).
- Intelligent path shortening — identifies long components, shortens the longest first, preserves extensions, and adds a short SHA-1 identifier; rechecks the full path and only shortens as much as needed.
- Filename hygiene — replaces
< > : " / \ | ? * and control characters with underscores; fixes reserved Windows device names automatically.
- Safety first — Zip Slip and drive-qualified/absolute-path entries are rejected; extraction continues past individual failures; cancellation is supported mid-run; optional overwrite protection with numbered alternatives.
- Responsive UI — extraction runs on a background thread with overall progress, an activity log of renamed/skipped/failed entries, and timestamp preservation where possible.
- Zero dependencies — pure Python 3.9+ standard library (
zipfile, hashlib, pathlib, tkinter and friends). ZIP archives only — no RAR, 7z or TAR.
System Requirements
Minimum: dual-core CPU, 4 GB RAM, Python 3.9+, Tkinter, enough free disk space for the extracted content. Recommended: quad-core, 8 GB RAM, SSD, and at least twice the compressed archive size free during extraction. Windows is the primary target; macOS 11+ and Ubuntu 20.04+ (or any Linux with Python + Tkinter) are also supported.
Installation
From source, with or without a virtual environment (no packages are installed either way):
git clone https://github.com/PeaBox-Lab/zip-extractor-with-path-fix.git
cd zip-extractor-with-path-fix
python -m venv .venv
# Windows: .venv\Scripts\activate
# Linux/macOS: source .venv/bin/activate
pip install -r requirements.txt # empty by design: stdlib only
python app.py
Verify your Python and Tkinter first: python --version and python -m tkinter (a small test window should open). On Ubuntu/Debian: sudo apt install python3 python3-tk python3-venv -y. On Fedora: sudo dnf install python3 python3-tkinter. On Windows, reinstall Python from python.org with Add Python to PATH and the Tcl/Tk component ticked.
Quickstart — 30 Seconds to Extracted
git clone https://github.com/PeaBox-Lab/zip-extractor-with-path-fix.git
cd zip-extractor-with-path-fix
python app.py # or double-click run.bat on Windows
Click Add ZIP files, pick an archive, keep output at the default, press Extract all, then Open output folder. Done — deep paths and odd characters already handled.
Configuration
The app has no config files or environment variables — every option lives in the UI:
- Maximum path length — default
220 characters; lower to 200 for stubborn cases, raise only if your filesystem supports it.
- Output directory — prefer a short root such as
C:\Extracted for deeply nested archives; avoid extracting into OneDrive/SharePoint sync or network-drive folders.
- Overwrite — off by default (numbered alternatives are created); enable only when replacement is intended.
- Timestamps — preserve original archive timestamps where stored.
Security Features
Zip Slip protection rejects entries like ../outside.txt and drive-qualified or absolute paths. Invalid filename cleanup replaces < > : " / \ | ? * and control characters with underscores. Reserved names such as CON, NUL and COM1 are adjusted automatically. Collision handling generates numbered alternatives rather than silently overwriting. Password-protected entries cannot be read and are reported as skipped; other entries continue. Note: password entry is not currently available in the GUI.
Building a Standalone Windows EXE
python -m pip install --upgrade pyinstaller
python -m PyInstaller --noconfirm --clean --onefile --windowed --name "ZIP-Extractor-Path-Fix" app.py
Or double-click build_windows.bat. Output lands at dist\ZIP-Extractor-Path-Fix.exe; end users need no Python, pip, Tkinter or PyInstaller. Unsigned PyInstaller executables may be flagged by some antivirus products — consider code signing for public distribution. Automated tests: python -m unittest -v test_app.py.
Troubleshooting
python is not recognized — Python isn't on PATH; try py --version, or reinstall and tick Add Python to PATH.
- Tkinter is missing —
sudo apt install python3-tk -y (Debian/Ubuntu), sudo dnf install python3-tkinter (Fedora), or reinstall Python with Tcl/Tk on Windows.
run.bat does nothing — run python app.py from a Command Prompt in the project folder to see the startup error.
- A path still can't be extracted — choose a shorter destination like
C:\Extracted, reduce max path to 200, avoid OneDrive/network paths, and read the activity log for the exact entry.
- Access denied — pick a writable output folder, avoid protected locations (
C:\Windows, C:\Program Files), close files open in other apps, check security software.
- Damaged ZIP — the log reports unreadable entries and continues with the rest; verify the archive with another utility if everything fails. Disk-space shortfalls are not estimated beforehand — check free space first.
Release & License
Released under CC0-1.0 (Creative Commons Zero) — use it for personal or commercial purposes without asking permission, per the LICENSE file. No warranty. Roadmap ideas (drag-and-drop, password entry, dry-run preview, disk-space checks, dark mode, TAR support, context-menu integration, signed installer) are listed in the README but not yet implemented — treat this as an early-stage but fully functional tool.
github.com/PeaBox-Lab/zip-extractor-with-path-fix · PeaBox Lab help & docs