Suspect of shim.exe unable to pass stdin to the real executable #6263
-
I'm using streamlink to watch streams and lives with VLC. Recently I had my new computer and I decided to install VLC via scoop, finding that streamlink cannot work with VLC installed by scoop but work fine with manually installed VLC. def _open_subprocess(self, args: list[str]):
log.debug(f"Opening subprocess: {args!r}{f', env: {self.env!r}' if self.env else ''}")
environ = dict(os.environ)
environ.update(self.env)
# Force bufsize=0 on all Python versions to avoid writing the
# unflushed buffer when closing a broken input pipe
self.player = subprocess.Popen(
args,
bufsize=0,
env=environ,
stdin=self.stdin,
stdout=self.stdout,
stderr=self.stderr,
)
# Wait 0.5 seconds to see if program exited prematurely
if not self.running:
raise OSError("Process exited prematurely") Args that should be passed to [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
struct STARTUPINFO {
// ...
public IntPtr hStdInput;
public IntPtr hStdOutput;
public IntPtr hStdError;
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Well well well, I found the solution by myself eventually... |
Beta Was this translation helpful? Give feedback.
Well well well, I found the solution by myself eventually...
There already have an issue about stdio broken, and cqjjjzr contributes to kiennq's shim implement about passing stdio, but this somehow only works for non-gui apps (kiennq/scoop-better-shimexe#14) so it was fixed in v3.1.2, when this time scoop's repo still not follow up kiennq's shim.
So after I manually replace shim.exe at
\scoop\apps\scoop\current\supporting\shims\kiennq
with latest version and doscoop reset *
, everything works well now.Conclusion: follow up latest shim.exe now!