Monkey patch for subprocess to use 8.3 filenames - Windows only (no dependencies)
Project description
Monkey patch for subprocess to use 8.3 filenames - Windows only (no dependencies)
Tested against Windows 10 / Python 3.10 / Anaconda
pip install subprocessmonkey
The module automatically converts long paths to their short 8.3 equivalents
import subprocess
from subprocessmonkey import patch_subprocess,subprocconfig
subprocconfig.minlen = None # minimum path length - calculated automatically if None
subprocconfig.convert_to_abs_path = True # \Windows to c:\\Windows
patch_subprocess() # updates subprocess.list2cmdline and subprocess.Popen._execute_child
# Works like a charm :)
subprocess.Popen(r"ffplay C:\Users\hansc\Videos\sdf dsf sdf .mkv")
subprocess.Popen(r'cat C:\Users\hansc\Downloads\hosts (1)')
subprocess.run('ls C:\\Program Files')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
subprocessmonkey-0.10.tar.gz
(6.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file subprocessmonkey-0.10.tar.gz.
File metadata
- Download URL: subprocessmonkey-0.10.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7670f4eb641017aebf8e824e3929a2294c5a1a2909d4a6e6f4fdad1359db7328
|
|
| MD5 |
7fd5342484720b8209cf78ec96b308b7
|
|
| BLAKE2b-256 |
5130937679d51b9832ae229363163b5fac773d194078651119c1e074d3f48fd1
|
File details
Details for the file subprocessmonkey-0.10-py3-none-any.whl.
File metadata
- Download URL: subprocessmonkey-0.10-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c5845ccd2cb930f5ed7183a513037e0cdeac42bb53de5371dd414ae5f5a8a0f
|
|
| MD5 |
cb204b48b25ad64401df32a07bffc107
|
|
| BLAKE2b-256 |
91dcb81ce90ec162500f855d9c7265102f7bfdb56b39c7d53e8b75072d1f51f2
|