Skip to content

Commit 6a44ba5

Browse files
committed
Fix for WindowsError: [Error 6] The handle is invalid
In subprocess.py there is an if statement for when stderr is None. This is the code that is failing because subprocess wants to access `_subprocess.GetStdHandle(_subprocess.STD_ERROR_HANDLE)` and that errors for some reason. The error in subprocess.py should be addressed however, Python 2 is at end of life soon so I suggest this woraround when using pyinstaller to build the EXE.
1 parent c492a8f commit 6a44ba5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Mopy/bash/archives.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def extract7z(src_archive, extract_dir, progress=None, readExtensions=None,
8383
command = _extract_command(src_archive, extract_dir, recursive,
8484
filelist_to_extract)
8585
proc = subprocess.Popen(command, stdout=subprocess.PIPE, bufsize=1,
86-
stdin=subprocess.PIPE, startupinfo=startupinfo)
86+
stdin=subprocess.PIPE, stderr=subprocess.PIPE,
87+
startupinfo=startupinfo)
8788
# Error checking, progress feedback and subArchives for recursive unpacking
8889
index, errorLine, subArchives = 0, u'', []
8990
source_archive = src_archive.tail.s

0 commit comments

Comments
 (0)