nedsociety / pysandboxie

A python binding to Sandboxie
MIT License
12 stars 2 forks source link

when running "Piped execution of sandboxed processes Example" stucked #1

Closed lolove closed 3 years ago

lolove commented 3 years ago
Technology Version
Python 3.9.4
Sandboxie 5.49.7

Problem

when running "Piped execution of sandboxed processes Example" stucked

image

Code:

import sandboxie

sbie = sandboxie.Sandboxie()

# REQUIRED: apply 'piped_execution' template into settings so that we may initiate IPC
settings = sbie.make_sandbox_setting('default,piped_execution')
sbie.create_sandbox('testpy', settings=settings)

# Run cmd and provide input like subprocess.Popen
proc = sbie.piped_execute(['cmd'], name='testpy', hide_window=True)
with proc:
    proc.stdin.write(b'cd\nexit\n')
    proc.stdin.close()
    print(proc.stdout.read().decode())

    # Microsoft Windows [Version 10.0.18363.1198]
    # (c) 2019 Microsoft Corporation. All rights reserved.
    # 
    # D:\temp>cd
    # D:\temp
    # 
    # D:\temp>exit

# Check exit code
assert proc.returncode == 0
nedsociety commented 3 years ago

Hmm.. I cannot replicate the issue. Does the new sandbox (testpy) and the running processes appear in the Sandboxie interface while hanging?

nedsociety commented 3 years ago

If you're able to replicate issue and check the above things, then please comment then I'll reopen the issue.